ImageJ ROI Manager headless mode - I can't use overlays

I wrote an ImageJ macro to do some nuclei analisys and I can’t use the
headless mode due to the ROI Manager.
I searched a lot and the main answer is to use the overlays. My main problem
is that you can not “split” a composite overlay (like we do in ROI Manager).
I also couldn’t split the selection, before converting it to the overlays.

[My images have the selection of several nuclei and this selection is made
automatically with edit>selection>create selection. So, my image has a
composite selection of several “oval-like” poligons and I don’t know how to
split it. With the ROI Manager I would add this selection to the ROI and
then split them]

Thank you everybody!

Hi @Luiza_Cherobini_Pere,

Hope you have saved the roi. Now once you open the ROI, open the saved roi in that. Further you try to split it. In case you have many combined rois then you might need a for loop in the macro.

Regards,
Lakshmi
Fujifilm Wako Automation (Consultant)
www.wakoautomation.com
For Image Analysis Training or optimised pipeline write to,
lakshmi.balasubramanian.contractor@fujifilm.com

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS
https://www.wakoautomation.com/products/yokogawa-high-content-imaging

Hello Lakshmi!

Thanks for the answer, but to create these ROIs I have to use the GUI, and my main goal is to use the headless mode for the entire analysis.

Best regards,
Luiza

Hi @Luiza_Cherobini_Pere,

You had mentioned that you are creating the ROIs automatically. So my understanding is that you have the ROIs of Nuclei already. Nevertheless, you could create the ROIs by two ways,

  1. Threshold the nuclei & create the mask; Get the outlines & add them to the ROI Manager using “Analyse Particles”; save the ROI & use it later.
  2. Other way is mark the ROIs (may be manual) & add to the ROI Manager.

It is also bit unclear that, do you have trouble in getting the ROI?
Also, we could help you better in case you could share a sample image (if you can) or the script you are trying.

Regards,
Lakshmi
Fujifilm Wako Automation (Consultant)
www.wakoautomation.com
For Image Analysis Training or optimised pipeline write to,
lakshmi.balasubramanian.contractor@fujifilm.com

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS
https://www.wakoautomation.com/products/yokogawa-high-content-imaging

1 Like

Hello Luiza -

If you’re comfortable using a scripting language (such as jython, a
version of python that is integrated with ImageJ) instead of ImageJ
Macro (IJM), you could use a ShapeRoi and its getRois() method
to split your composite Roi.

I also believe it should be possible to write most of your analysis
in IJM, and just do this bit of the Roi manipulation in jython, using
IJM’s runMacro() or eval() function (after installing jython.jar)
to run the jython part:

runMacro ("name_of_jython_script_in_macros_directory");
eval ("python", string_that_is_the_jython_code);

(You could also write and install a small jython plugin, and run() it
from IJM.)

Thanks, mm