Search code examples
macrosimagej

fiji macro how to use given luts and plugin


I need to write a macro in Fiji. First I record a macro to do what I wanted. The result was the following:

run("Size...", "width=512 height=512 depth=497 average interpolation=None");
run("Rotate 90 Degrees Right");
run("Flip Horizontally", "stack");
run("Make Substack...", "  slices=5-300");
run("isolum_cbs_strict");
run("Z Code Stack", "depth=Current");
run("Z Project...", "start=1 stop=296 projection=[Standard Deviation]");

I would like to do it in a batch mode. So I write a macro myself:

file = getArgument;
if (file=="") exit ("No argument!");
setBatchMode(true);
file_vasc = file;
open(file_vasc);
run("Size...", "width=512 height=512 depth=497 average interpolation=None");
run("Rotate 90 Degrees Right");
run("Flip Horizontally", "stack");
run("Make Substack...", "  slices=5-200");
run("isolum_cbs_strict"); 
run("Z Code Stack", "depth=Current");
run("Z Project...", "start=1 stop=196 projection=[Max Intensity]");
file_vasc_out = replace(file, "\\_pvar-8bit_combined.tif", "_maxZprojection.tif");
saveAs("Tiff", file_vasc);

However I got macro errors as undefined variable for run("isolum_cbs_strict") and a unrecognized command for run("Z Code Stack", "depth=Current"). How can I access to this lut which is in:

C:\Program Files\Fiji.app\luts\isolum_cbs.lut

and to the plugin which is in:

C:\Program Files\Fiji.app\plugins\Stacks - Z-functions

Thanks for your help,

Corinne


Solution

  • A solution is to provide -ijpathpath as argument to Fiji. Then, luts, plugins, etc. are all derived relatively to this path. In other words, pass the following argument:

    -ijpathpath "C:\Program Files\Fiji.app"

    Note that, importantly, you must not have a backslash at the end of the path.