Skip to content

ImageJ Macros

ImageJ has a rudimentary macro language that can automate your workflow. If you are repetitively executing a few commands/plugins in ImageJ, you can probably automate your workflow. This page will help you get started with the ImageJ macro language.

  1. Getting Started
  2. Installing ImageJ Macros
  3. Useful Macros
  • Take a look at the ImageJ macro language PDF page.
  • Code examples are the best way to learn. ImageJ provides a couple hundred examples PDF.
  • A comprehensive list of all available macro commands is a great reference (dead link).

Taken from the macro language PDF page:

  1. Save a macro file in the macros folder inside the ImageJ folder. (Note that the “.txt extension is required.)
  2. To install the macros in the Plugins>Macros submenu, use the Plugins>Macros>Install command and select ”MyMacros.txt” in the file open dialog.
  3. Change the name to “StartupMacros.txt” and ImageJ will automatically install the macros when it starts up.

Please feel free to upload any useful macros here.

  1. ijf_cliproifortracking.txt - Create and save the current ROI as a sub-stack for eventual particle tracking.
  2. ijf_cliproifortracking2.txt - Modified ‘ijf_cliproifortracking’. Fixes box ‘range’ for normal ImageJ. Also adds new sub macro to just box and not save.
  3. default_traker.txt - Super simple macro to run Mosaic 2D partical traker with custom default values. For some reason you need to run twice