ImageJ macro support
JIPipe supports the execution of most ImageJ macros through a node:
- Run ImageJ macro
Executes the macro for each iteration step. Each slot receives exactly one data item per step.
Background
The integration works by first making the incoming data available as objects (images, tables, etc.) that can be accessed through standard ImageJ macros. See the ImageJ scripting documentation for more details. After the execution of the macro, JIPipe gathers outputs and converts them back into JIPipe-accessible data.
Due to the limited set of data types supported by ImageJ, JIPipe will apply the following operations depending on the data type:
Data type | To ImageJ | From ImageJ |
|---|---|---|
Image (ImageJ image etc.) | Will open the image in an ImageJ image window that is named after the input slot | Will look for an ImageJ image window named after the output slot |
Table (ImageJ table etc.) | Will store the table data into an ImageJ table window. To write into the standard ImageJ results table, name the input | Will look for an ImageJ table that is named after the output slot. To extract the standard ImageJ results table, name the output |
Paths (Files/Folders/Paths) | Will create a table with one row and a single column | Will look for an ImageJ table named the output slot, take the first column and assume that the rows of that column contain the paths to be put into the output. |
While other data types are technically supported, they may behave unexpectedly.
Writing ImageJ macros
You will need to adapt your macro code to work with how JIPipe interacts with ImageJ. A good way to get started is the following code that applies a Gaussian blur macro to each image received by the input Input and returns the resulting image back to JIPipe by renaming the output image Output (the name of the output slot):
Passing parameters
You can create macro parameters that will be automatically injected into the macro code by JIPipe. To do this, click the button within the category and create a new parameter. The key will be used as a variable name in the macro code.