Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Name of ROIs in OMERO #14

Open
JensWendt opened this issue Jan 3, 2023 · 7 comments
Open

Set Name of ROIs in OMERO #14

JensWendt opened this issue Jan 3, 2023 · 7 comments

Comments

@JensWendt
Copy link

Hello,

I stumbled upon your great plugin and try to incorporate it into a bigger workflow.
A quick overview:

  • run Cellprofiler with Cellpose on a whole 384 plate to generate segmented ROIs with associated measurements
  • use your Fiji plugin with a custom ImageJ macro that converts 16-bit mask images (output from Cellprofiler) to ImageJ ROIs and then upload them to the corresponding image in OMERO with your plugin
  • upload all the ROI-specific measurements into OMERO via populate metadata and the .csv generated by Cellprofiler

So far I made good progress but stumbled upon the fact, that ROIs generated by your plugin do not have a name or description in OMERO, although they have a comment in the iViewer which shows the correct name they had in Cellprofiler/Fiji.
Without ROI name it is unfortunately not possible to associate the ROIs with their respective measurements with populate metadata.
Could you maybe implement a roi.setName() here?


The goal is to have what is a comment now as the ROI.name.
Unfortunately I lack the Java knowledge and cannot make a pull request on my own.

@ppouchin
Copy link
Member

ppouchin commented Jan 4, 2023

Hi @JensWendt!

So far I made good progress but stumbled upon the fact, that ROIs generated by your plugin do not have a name or description in OMERO, although they have a comment in the iViewer which shows the correct name they had in Cellprofiler/Fiji.
Without ROI name it is unfortunately not possible to associate the ROIs with their respective measurements with populate metadata.
Could you maybe implement a roi.setName() here?

I'm just curious: do you usually see ROI names in OMERO? Because I was under the impression only comments on shapes were visible. As mentioned in this thread, the Java Gateway does not provide a setName method for ROIData, and this name is not properly displayed by the viewer for now apparently.

Nevertheless, I'll see if I can incorporate what was mentioned in the thread I linked into the underlying library (Simple OMERO Client), which I still haven't done (despite mentioning it months ago). My workload has slowed the tools development quite a bit the past few months, but I'm still trying to improve them.

@JensWendt
Copy link
Author

Hello @ppouchin ,

I do not see the ROI names in OMERO.
I am also not quite aware of the interplay between ROIData and "actual" ROI.
I was under the impression you have to create an omero-model-ROI which you then save to OMERO. at least this object has a setName()
Alternatively if one can access the shape comment via python I could try and write a script which gets all ROIs of an image, gets the comments of the corresponding (single) shape and sets it as a name for its ROI

@ppouchin
Copy link
Member

ppouchin commented Jan 10, 2023

Hi,

What should be set as the ROI name?

Edit: Ok, I'm changing how things work a bit. Currently, the "ROI" property is a local index. I'll change that to the ROI name.

@JensWendt
Copy link
Author

Hi,
For my process I would need the names of the OMERO-ROIs to be the same as the names of the ROIs in Fiji.
The reason being, I use a Fiji macro in your plugin that goes through mask/label images and creates ROIs out of the different objects and names them according to the grey-value (which was the object number in CellProfiler, where the label image was created).
I then need the ROIs to have the same name in OMERO as they had in Fiji (and previously CellProfiler) because I want to put an OMERO.table on their Dataset with the individual ROI-measurements coming out of CellProfiler.
The mapping will only work if the names are congruent.

Somehow you can read those ROI names in Fiji it seems, as now they are put as Comment of the shapes.

Generally speaking I think people would expect the ROI name to be consistent between OMERO and Fiji.

PS: Just out of curiosity, are you strictly attaching one Shape to one ROI, or is there a possibility for multiple Shapes (previously Fiji-ROIs) for one OMERO-ROI?

@ppouchin
Copy link
Member

Currently, I import Fiji ROIs as shapes in OMERO.
However, to group multiple "shapes" in one OMERO ROI, a property ("ROI") must be set and share the same value for shapes that belong to the same 4D ROI.

For example, if you create 4 squares in different planes through a Fiji macro, you can put them in one OMERO ROI if you use Roi.setProperty("ROI", "1"); on each one: the batch plugin will check which ROIs share the same value and group them.

For now, it expected this value to be numeric (corresponding to a local index), but what I'll do is use this as the ROI name.

@ppouchin
Copy link
Member

Updating"simple-omero-client-5.9.2.jar" to the 5.9.3 version should allow you to set the ROI name from Fiji by putting in your macro Roi.setProperty("ROI", roiName);. You can also define the shape name (in a given slice) by setting the Roi name in Fiji: Roi.setName(shapeName);.

@JensWendt
Copy link
Author

I will try it out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants