Hi @noreenw,
yes I am using jython scripting language.
I had found that api page but there is still a step that I think I am missing, what is the input of that call?
resultPlus = LabelImages.keepLargestLabel(imagePlus)
how it is supposed to be the ImagePlus that I pass?
for example this snippet, doesn’t produce an image with only the largest region, but it doesn’t throw any error: it simply returns the input ImagePlus
from ij import IJ
from inra.ijpb.label import LabelImages
imp = IJ.createImage("Untitled", "8-bit black", 512, 512, 1);
imp.setRoi(65,26,198,212);
IJ.run(imp, "Set...", "value=255");
imp.setRoi(366,353,39,45);
IJ.run(imp, "Set...", "value=255");
largest_region = LabelImages.keepLargestLabel(imp)
largest_region.show()
Do I have to “labelise” someway the imageplus?
thank you for your help
Emanuele