Development of LabelsToROIs FIJI/ImageJ plugin

Development of LabelsToROIs plugin

There have been many recent machine learning tools created for image segmentation and object detection that work astoundingly well, such as the amazing #cellpose . In many cases, these algorithms generate their output in the form of labeled images. For a computer scientist or a user well versed in image analysis using programming languages, the use of label images is common practice, and thus they can rapidly incorporate these algorithms into their everyday routines. However, other users without this specific knowledge are significantly more limited in taking advantage of these tools.

I created this simple ImageJ plugin to convert labeled images into ImageJ ROIs. The plugin, written in Jython, incorporates a tool to erode/dilate the ROIs, which can be useful to “adjust” the segmentations, especially when area-related measurements are intended. It also allows to easily save the ROIs, measurement tables, jpg-image of the original image+overlaid ROIs, and batch conversion and measurement of many images at the same time.

The intention was to make these kinds of analyses easier for users without programming skills.
You can find the plugin and a tutorial in the GitHub page below.

Any comments are very much welcome!

6 Likes

Dear Ariel,

I’m trying to use your plugin but as soon as I hit “next” after the directories of the original and label files are found, Fiji just shuts down…

Sincerely,

Matthieu

Dear Matthieu,

I am sorry to hear you had problems trying to run the plugin. Could you send me more details about the platform in which you’re running it? Windows, Mac, Linux?
I tried it on the three platforms and it worked. Also, which version of FIJI/ImageJ are you using? You should try to download the latest version of FIJI and see if it works there. Thanks very much for your input. Let me know if that helped.

Cheers
Ariel

Dear Ariel,

I’m running an up to date Fiji on Windows 10. I’ve tried it on a newly installed version of Fiji without any extra plugin and get the same behaviour: the plugin opens the files and then closes Fiji.

These are the files I was testing the plugin with: blobs.tif (63.6 KB). blobs-1-watershed.tif (255.8 KB)

Sincerely,

Matthieu

Hi Matthieu,

The problem is the 32-bit label image. I will add that to the tutorial. In a next release I’ll get it solved.
In the meantime, if you convert the label image to 8 or 16-bits (e.g. Image > Type > 16 bits), then it works fine. A 16-bit image can have up to ~56.000 unique labels, so unless you have more, that should work.

Hope that helps!
Have a nice weekend,
Ariel

2 Likes