To install ImageJ, install the Mac OS X .tar.gz file and double-click on it to extract the "ImageJ (OS X)" folder. To run ImageJ, open this folder and double-click on the ImageJ icon.
Memory
With ImageJ 1.32 or later, use the Edit/Options/Memory command to make more than 192MB of memory available to ImageJ.
With ImageJ 1.31, control-click on the ImageJ application, select "Show Package Contents" and open the "Contents" folder. Then open the "Info.plist" file by dragging and dropping on the TextEdit icon in the Dock and editing the line "<string>-Xms32m -Xmx192m</string>", which is near the end of the file. (If TextEdit is not on the Dock, drag it from the Application folder to the Dock.) As an example, to make 500MB available, change the line to "<string>-Xms32m -Xmx500m</string>".
With ImageJ 1.30 and earlier, use a text editor such as TextEdit to edit the line "com.apple.mrj.application.vm.options=-Xmx128M" in ImageJ/Contents/Resources/MRJApp.properties. Another way to make more memory available to ImageJ is by running from the command line and using the -Xmx option. The maximum amount of memory that can be allocated is about 1.7 GB.
Upgrading
To upgrade to the latest version of ImageJ, replace the ij.jar file in the ImageJ application with a newer one from http://rsb.info.nih.gov/ij/upgrade/. To do this, control-click on the ImageJ application, select "Show Package Contents", and then drag the newer ij.jar into the Contents/Resources/Java folder.
Drag and Drop
The OS X version of ImageJ opens images, text files, ROIs and LUTs that are dropped on the ImageJ icon.
Known Problems
- ImageJ crashes frequently on Panther (OS X 10.3). Upgrading to ImageJ 1.31 (which uses Java 1.4.1 or later) and to Java 1.4.2 should reduce the number of crashes. Enabling "Use JFileChooser" in Edit/Options/Miscellaneous may also help. This bug has been reported to Apple (ID# 3488737).
- With Java 1.4, the "OK" and "Cancel" buttons in dialogs are sometimes not visible. As a work around, resize the dialog.
- ImageJ cannot use more than about 1.8GB of RAM. This has been submitted to Apple as bug #3492928.
- Plugins that use QuickTime for Java do not work with Java 1.4. One exception is the Movie Opener plugin, which was modified by Jeff Hardin to work with Java 1.4.
- The "rubberband" is sometimes not visible or leaves "trails" when using the polygon or polyline tool to create a selection. This bug has been reported to Apple (ID# 3558433). ImageJ 1.32b and later work around this bug by not doing XOR mode drawing.
- OS X requires a lot of memory for each open window. Converting a 1024x1024x10x8-bit stack (10MB) to separate images requires 58MB of additional memory!
- Zoomed images may be blurry.
- Tab support is broken in Plugins/Edit (Fixed in Java 1.4.1).
- Arrow keys don't work in Plugins/Edit (Fixed in Java 1.4.1).
- Mouse wheel doesn't work in Plugins/Edit (Fixed in Java 1.4.1).
- There does not appear to be a way to unselect an ROI in the ROI Manager (java.awt.List bug). As a workaround, press the "Select All" button twice (v1.28d and later).
- Image drawing is very slow. The Plasma plugin and Plasma2 applet are test cases for this problem.
- Cut (cmd-x), copy (cmd-c) and paste (cmd-v) do not work in dialog boxes (Fixed in Java 1.4.1).
- Plot coordinates are not displayed if a profile plot window is moved (Fixed in Java 1.4.1).
- The "Paste" function of the System Clipboard plugin does not work.
- Interactive thresholding of 16 and 32 bit images does not work with Java 1.4. (Worked around in ImageJ 1.32c.)
- The available memory value displayed by ImageJ (1.32h or later) is 64MB too high when ImageJ is started by double-clicking on ij.jar or run from the command line due to a bug in Java's Runtime.maxMemory() method.
Adding a JAR File
Some plugins require adding a JAR file to ImageJ. In ImageJ 1.31 or later, this is done by copying the JAR file into the plugins folder or an immediate subfolder of the plugins folder, then restarting ImageJ. To compile a plugin that uses a JAR file, copy the JAR file to /Library/Java/Extensions.
Switching Beween Java 1.4.1 and Java 1.31
The ImageJ double-clickable application uses Java 1.4.1 or later. To use Java 1.3.1, control-click on the ImageJ application, select "Show Package Contents", open the "Contents" folder, drag and drop "Info.plist" on TextEdit, then change the value of the Root>Java>JVMVersion property from "1.4+" to "1.3.1". Duplicate ImageJ before making these changes to create separate Java 1.3.1 and Java 1.4 versions.
It is possible to revert to Java 1.3.1 when running Java programs from the command line or by double clicking on a jar file bytyping these two commands into a Terminal window:
cd /System/Library/Frameworks/JavaVM.framework/Versions
sudo ln -sfh 1.3.1 CurrentJDK
This switches the symbolic link for the current JDK to 1.3.1. You can view what the CurrenJDK is pointing to by running (in the same directory):
ls -al
Running from the Command Line
To run ImageJ from the command line, open a Terminal window, cd to the ImageJ directory, then use the java command to run ImageJ. The easiest way to do this is to drag the ImageJ folder to the Terminal Window, type return, then type:
java -jar -mx256m ImageJ.app/Contents/Resources/Java/ij.jar
(or java -mx256m -cp ImageJ.app/Contents/Resources/Java/ij.jar ij.ImageJ)
Or if ij.jar is in the current directory, type:
java -jar -Xmx256m ij.jar
(or java -Xmx256m -cp ij.jar ij.ImageJ)
The -Xmx256m switch specifies that ImageJ will have available a maximum of 256MB of RAM.
Here is a simple AppleScript that sends commands to Terminal to have it automatically launch ImageJ:
tell application "Terminal"
run
do script with command "cd /Applications/ImageJ
java -jar -mx350m ./ImageJ.app/Contents/Resources/Java/IJ.jar"
end tell
With OS X 10.1 or later, you can also run ImageJ by double-clicking on ij.jar.
|