Help with setBatchMode(false) when running macro

Tags: #<Tag:0x00007fa30b9aae38> #<Tag:0x00007fa30b9aac08>


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 :)?
Thank you!


Good day!

“Batch” with ImageJ has at least three quite different meanings.

  1. “Process >> Batch”
  2. BatchMode as a ImageJ macro call.
  3. Terminal operation

re 1.
Please tell us if you use the functionality.

re 2:
Please consult the list of commented Macro functions:

   //your macro code

Even if images aren’t visible they can be accessed!
I’m quite sure that the crash is not due to proper usage setBatchMode().





Please replace selectWindow() with 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)