Congratulations on your first post.
If I get you right, you are trying to view masks in OMERO.iviewer on OME-TIFF images which you have created. You have validated locally their OME-XML headers but you are not seeing the masks after you imported such an OME-TIFF image into OMERO.
There could be several possible reasons:
- The masks do not have any binary data in your OME-TIFF.
- The masks got imported, but you are not able to view it in OMERO.iviewer because
a. the masks could be outside the image
b. the masks’ borders are too thin
I do not know which of the above reasons is the true one.
The Ad. 1 above is most probable, as I am able to repeat a similar workflow to yours.
- First, I have a mask in OMERO on an image
- Then I export it as OME-TIFF
- Then re import the exported OME-TIFF into OMERO.
- On the reimported image in OMERO, there is a mask listed in the ROI table of OMERO.iviewer, but the mask is not visible on the image. This is probably because during the export, the binary data of the mask do not seem to have been written into the OME-XML header of the OME-TIFF. The mask is declared in the OME-XML, but the binary data is missing. I imagine you are using a similar workflow when writing the OME-TIFF out from your software and thus getting similar problems .
The Ad. 2a above is possible, please check the position of your mask with respect to the image sizes. I have managed to get a completely invisible mask in OMERO.iviewer when preparing some example OME-XML containing masks for you (see below more about that). The parameters to adjust are the X and Y in the header of the masks xml bit.
The Ad. 2b above is possible as well, and can be verified or refuted easily, by clicking onto the line with the ROI mask shape in the right-hand side table. In such a case, the mask might still not be visible, but the encompassing rectangular border will show in the image as blue. See the screenshot attached to this post.
You further ask for an example of OME-TIFF with a mask. I do not have the OME-TIFF for you. Nevertheless, I am attaching a valid and tested OME-XML file to this post with a mask element in it. This file can be imported into OMERO (see below how) onto any image of your choice which is larger than the size of the mask (if the image is smaller than the mask XY offset position, then the problem 2a above will occur. You can simply adjust the X and Y parameters of the mask inside that OME-XML, setting them to zero, and import the OME-XML again into OMERO. )
The way to import the the OME-XML into OMERO is highlighted in the QuPath walkthrough of the omero-guides, see step 36 of Analyze OMERO data using QuPath — OMERO guide 0.2.0 documentation please. In the same walkthrough, you will see in Resources what version of ome-omero-roitool plugin to use for your import and how to get this plugin from GitHub. This OME-XML was created in QuPath using the walkthrough I am pointing you to. Feel free to go through it, but if you want to spare time, you might just use the OME-XML and step 36 to explore the behaviour of the mask in your OMERO.iviewer and get inspiration from the OME-XML layout.
Further, you might be interested in how the OME-XML was written. The code for that is inside the following groovy script for QuPath. There is a short description of this export script in README which will give you an idea about the ROI objects writing and matching in the QuPath case. It can also give you a hint regarding the problem 2b above (line width), although, in your case, you cannot overtake this width hint directly for your workflow.
Finally, if you think it is helpful, then you can go through the QuPath walkthrough yourself in full and create any OME-XML files with masks from images which you choose to open in QuPath. You just have to draw a “magic wand tool” ROI on the image in QuPath and use the export script. But please do not draw too big ROIs, as the export script might not scale well with the size of the exported masks, and you may hit performance issues. For the OME-XML I am pointing you to, I have used the image which is publicly available on IDR - you can open it in QuPath without downloading it, just following the instructions in the QuPath walkthrough as indicated above and putting in this url when asked for the url to the image. The screenshot I am attaching to this post is showing a mask which I created as OME-XML and re-imported into another OMERO server on that very image (I could not import it into IDR, as this is a read-only server, so if you want to go exactly down this route, you would have to download the image locally. Let me know if you think you need/want to have this precise image, I will give you instructions about how to get it.
Lastly, let me give you a link to an example of a mask in OMERO from IDR This mask is very different from the one in the OME-XML I am giving you above and was created in a different manner, but you will definitely be able to view it, just to get an idea about how masks are displayed in OMERO.iviewer.
for-forum-post-exported-from-QuPath.ome.xml (22.1 KB)