I have written a macro that performs color deconvolution on immunohistochemistry image to separate out the DAB staining and then akes into binary. I am running it in batch processing on a large set of images. In the macro I am using selectWindow("…"+imageTitle); to select the deconvoluted image that I’d like to make binary. However, when I try to speed up the macro by running it in setBatchMode(false), it crashes. I suspect that the reason is that no window is opened and so it can’t select? Any suggestions on how to circumvent this or am I completely off track :)?
“Batch” with ImageJ has at least three quite different meanings.
- “Process >> Batch”
- BatchMode as a ImageJ macro call.
- Terminal operation
Please tell us if you use the functionality.
Please consult the list of commented Macro functions:
setBatchMode(true); //your macro code setBatchMode(false);
Even if images aren’t visible they can be accessed!
I’m quite sure that the crash is not due to proper usage setBatchMode().
selectImage() this should alleviate any issues in that regard.
Let us know if it works! Otherwise feel free to post your macro and we can have a look!
I do the same thing in one of my macros and it works…setBatchMode(false) should be setBatchMode(true)