A repository containing ImageJ macros for the Snyder Lab.
imagej-macros are written in imagej macro language
python-macros are written in Jython
This is how I would recommend using these macros:
- Download repository
- As zip or using
git clone https://github.com/boonepeter/snyder-imagej
- As zip or using
- Install or open Fiji
- Open the desired script in Fiji
- Drag and drop or File > Open
- Click Run
A good place to start:
Plugins > Macros > Record...
- Open up and image and process it
File > New > Script...
Templates > ImageJ 1.x > Batch > Process Folder (IJ1 Macro)
- Then copy your recorded macro into the function section
- You will need to generalize some of your recorded macro so it will work
- Add
setBatchMode(true);
beforeprocessFolder(input);
to speed up your macro (ImageJ will not display images as it works)- See my example script to view this
- AN IMPORTANT NOTE:
- The macro recorder sometimes does not record certain settings if they are not changed. An example of this happens when you use
run("Analyze Particles")
on a binary image. This will measure all of the particles, but it will only output the measurements checked by the last user (or default). To make sure you get the measurements you want, you need to doAnalyze > Set Measurements...
and check what you want while the macro recorder is running. I would recommend you check settings like this while you are recording your macro so it will work later on.
- The macro recorder sometimes does not record certain settings if they are not changed. An example of this happens when you use
- Intro to Macro Programming - Good place to start when recording macros
- ImageJ Scripting - Overview of scripting
- Image.sc Forum - Great resource for ImageJ and other image analysis questions. I am
@boonepeter
on there - Macro Language Reference - Decent reference
- Script Parameters - These are a great way to generalize your script