OS X Installation

Installation

Download ImageJ for Mac OS X from the Download page. The ZIP file you download (Image1.xx.zip) should automatically expand to Image.app, which is normally copied into the Applications folder. If the "ImageJ" window is too small, set "GUI scale" in the Edit>Options>Appearance dialog to a value greater then 1.0.

The first time you run ImageJ, you may get get an "ImageJ can't be opened because it is from an unidentified developer" message, which can be bypassed by right clicking on ImageJ.app and selecting "Open" from the drop down menu

MacOS 10.12 (Sierra) and later have a security feature called Path Randomization that can cause ImageJ to not work as expected. Path randomization is in effect if the "ImageJ home" path shown in the Image>Show Info window starts with "/private" and plugins are not installed in the Plugins menu. You can disable path randomization by dragging ImageJ.app to another folder and then (optionally) dragging it back.

Memory

Use the Edit>Options>Memory & Threads command to make more than default 3000MB of memory available to ImageJ. Note that setting the "Maximum Memory" value to more than about 75% of real RAM may result in poor perfomance due to virtual memory "thrashing". The maximum amount of memory that can be allocated on 32-bit systems is about 1.8GB. Another way to make more memory available to ImageJ is by running from the command line and using the -Xmx option.

The Edit>Options>Memory command updates the VMOptions key in the Contents/Info.plist XML file in the ImageJ.app bundle.

    <key>VMOptions</key>
    <string>-Xms256m -Xmx3000m</string>
You will get an error message if you do not have write permission for the ImageJ application. To check and/or change the permissions, select ImageJ.app and use the Finder's File>Get Info command.

Upgrading

Use the Help>Update ImageJ command to upgrade to the latest version of ImageJ. This command may fail with a "Release Notes are not in the expected format" error if you are running a version of ImageJ earlier than 1.50i. You can work around this problem by using the ImageJ Updater plugin to upgrade.

Drag and Drop

The OS X version of ImageJ opens images, text files, ROIs and LUTs that are dropped on the ImageJ icon or on the "ImageJ" window. Drag and drop TIFF files on the >> icon in the toolbar to open them as virtual stacks.

Known Problems

  1. The first time you run ImageJ you may get a "ImageJ can't be opened because it is from an unidentified developer" message.
  2. Plugins may not be installed when running macOS 10.12 (Sierra) due to Gateway Path Randomization.
  3. Text cannot be entered into dialog boxes on macOS 10.13 (High Sierra) when ImageJ is using Java 6 .
  4. Commands (e.g. File>Import>Video) and plugins that use QuickTime for Java fail with 64-bit versions of Java and with OS X 10.10 (Yosemite) and later .
  5. Using command-v to paste text into the file name field of Save As dialog boxes does not work. This is a bug in the Java FileDialog class that can worked around by right-clicking in the name field and selecting "Paste" from the drop down menu.

Running from the Command Line

To run ImageJ from the command line, open a Terminal window, cd to the ImageJ.app directory, then use the java command to run ImageJ. The easiest way to do this is to type "cd ", drag ImageJ.app to the Terminal Window, type return, then type:
java -jar -Xmx4096m Contents/Java/ij.jar
The -Xmx4096m switch specifies that ImageJ will have available a maximum of 4096MB (4GB) of RAM.

Use a command like this to run ImageJ from any directory:

java -Xmx4096m -jar /Applications/ImageJ.app/Contents/Java/ij.jar -ijpath /Applications/ImageJ.app
ImageJ recognizes the following command line options:
  "file-name"
     Opens a file
     Example 1: blobs.tif
     Example 2: /Users/wayne/images/blobs.tif
     Example 3: e81*.tif

  -macro path [arg]
     Runs a macro or script (JavaScript, BeanShell or Python), passing an
     optional string argument, which the macro or script can be retrieve
     using the getArgument() function. The macro or script is assumed to 
     be in the ImageJ.app/macros folder if 'path' is not a full directory path.
     Example 1: -macro analyze.ijm
     Example 2: -macro script.js /Users/wayne/images/stack1
     Example 2: -macro script.py '1.2 2.4 3.8'

  -batch path [arg]
    Runs a macro or script (JavaScript, BeanShell or Python) in
    batch (no GUI) mode, passing it an optional argument.
    ImageJ exits when the macro finishes.

  -eval "macro code"
     Evaluates macro code
     Example 1: -eval "print('Hello, world');"
     Example 2: -eval "return getVersion();"

  -run command
     Runs an ImageJ menu command
     Example: -run "About ImageJ..."
     
  -ijpath path
     Specifies the path to the directory containing the plugins directory
     Example: -ijpath /Applications/ImageJ.app

  -port
     Specifies the port ImageJ uses to determine if another instance is running
     Example 1: -port1 (use default port address + 1)
     Example 2: -port2 (use default port address + 2)
     Example 3: -port0 (don't check for another instance)

  -debug
     Runs ImageJ in debug mode

About the Icon

The ImageJ icon for OS X is based on a photograph by Tom Grill of a
Hartnack microscope, circa 1870's, at www.arsmachina.com. A full size PNG version of the icon is available at rsb.info.nih.gov/ij/images/ImageJ.png.

Vulnerability Disclosure