imagej / imagej-legacy

ImageJ+ImageJ2 compatibility layer
https://imagej.net/libs/imagej-legacy
BSD 2-Clause "Simplified" License
16 stars 25 forks source link

Scijava batch processing do not work with macro language and ImagePlus input #216

Open NicoKiaru opened 5 years ago

NicoKiaru commented 5 years ago

Launching this macro:

#@ImagePlus img

selectImage(img);
print("The opened image has an id of "+img);

Do not work when using the batch button.

See this thread : https://forum.image.sc/t/scijava-batch-processing-with-macro-language/24881

The workaround is to use ´File´ objects if one want to use batch with macro language.

imagejan commented 2 years ago

Can this be solved while setting the bindings for the macro language when running the script? Essentially, when we assign parameter values (here), we could also call setTempCurrentImage to make the macro aware of the current image, or (less intrusively) somehow register it with the WindowManager... there must be some overlap with the functionality in pyimagej around macro calls, so I wonder if code for this exists somewhere already, and we just have to use it here as well (/cc @ctrueden, @hinerm, @gselzer).