MIB: connection to OMERO 5.5.x and segmentation masks

Hi MIB team,

I’m working with a team of electron microscopists who use MIB to segment and annotate their 3D FIB-SEM stacks. We are moving more of our data into an OMERO database and would like MIB to pull from there. In the past I’ve been successful getting MIB to connect to OMERO but currently with OMERO 5.5.1, the connection does not work. I did install the correct OMERO.matlab package and configured MIB to point to it. Is there a known issue and a known solution? When I try to connect I get a beep and in the command window an error: “Error using JavaObject. No class omero.client can be located … etc.”.

Second question: after the segmentation, we want to show the segmentation results in OMERO by importing the masks. Is there any documentation how MIB stores the segmentation results so I can convert and import them into OMERO? Or better yet, has anyone already written something to get the MIB masks into OMERO?

Thanks,
Damir

Hi Damir,
is that the very recent version of OMERO? Are you using Matlab or the compiled version?
If it is the compiled version, it is probably missing the recent OMERO files, I can try to check that tomorrow.
Considering the second question: as far as I recall, it may not be too difficult to write an export from MIB to OMERO, but because we are not using OMERO, I am not quite sure what is the best way to store the models there. I mean, the models have material names and colors and it would be nice to store those as well. Perhaps, using some meta-data… or do they have a data type specifically for segmentation results…?
How you normally do that? Do you save masks/models as TIF and import to OMERO?

Hi Ilya,
Thanks for the quick reply. Yes, OMERO 5.5.x is quite new, the first release was in June. I’m using the compiled version of MIB; my Matlab license is quite old and expired with R2016b but I’ll try that as well.

Yes, it would be ideal to import the ROIs/models with names, colors, etc. and indeed OMERO does support all of that data. I typically start with the segmentation masks as tiff or png files where the either foreground pixels are value 1 and background is value 0 or even better, where the foreground value is a label value per object. My python annotation routine converts that into OMERO ROI structures, assigns colors and names, and puts that into OMERO through the python API. while this may the easiest place to start, I’m sure all that can just as easily (or easier even) be done all within Matlab using the omero.matlab API package but I’m not Matlab facile.

Cheers,
Damir

Quick update: MIB under Matlab gives effectively the same error.

Loading omero settings from c:\temp\mib_omero.mat
Saving Omero settings to c:\temp\mib_omero.mat
Error using javaObject
No class omero.client can be located on the Java class path

Error in connectOmero (line 66)
client = javaObject(‘omero.client’, connArgs{:});

Error in mibImportOmeroController/omeroLoginBtn_Callback (line 72)
obj.client = connectOmero(result.server, result.port);
etc…

Thanks,
Damir

ok, thank you for the info, I will try to check that tomorrow at work

Hi Damir

OMERO 5.5.x requires Java 1.8. The version of Matlab you are using is not bundled with Java 1.8
So you might also have issue with that too unless you start Matlab with another JVM

Cheers

Jmarie

have you tried MIB for the recent release of Matlab?
It was compiled for R2019a and I think is using Java 1.8 already

Unfortunately my Matlab license only covers versions up to R2016b. I stopped paying the Matlab tax (okay, you got me, I’m stingy :slight_smile: ).

I’ll have to see if anyone in my lab has an up-to-date license.

Cheers,
Damir

No, no, no, I did not mean that :wink:
The current deployment strategy for MIB is to keep the compiled version with the same release of Matlab as much as possible. This allows users to do not update their Matlab libraries too often. At the same time, I make another compiled version of MIB, which is always compiled for the very recent release of Matlab. It is available on the website http://mib.helsinki.fi/downloads.html as " Standalone for Windows, recent Matlab", unfortunately, it is only for Windows because I do not have easy access to Macs.

Hi Damir,
so, I checked the case. It looks that the Matlab version of MIB works fine after the installation of omero-matlab 5.5.1 bindings. The deployed version (even for the recent release) complains about missing library.
I recompiled MIB (current beta) and included OMERO distribution into it. Now it should work, you can download if from here:
http://www.biocenter.helsinki.fi/~ibelev/temp/MIB2/MIB_Win_252_R2019b.exe

Please note, since it is beta, there may be some issues. I am using this release myself constantly, but still… For example, save as dialog has option to save images in OME-TIFF format, but it does not yet work properly.

Hi Ilya,
Thanks much for building a special version for me. I’ll check it out tomorrow. The new features also sound great so looking forward to seeing those in a future release.
Cheers,
Damir

@dsudar,
I found the problem with OMERO: the older versions of OMERO contained omero_client.jar, which was used by MIB to make the connection. In contrast, the structure of libraries in the recent releases has changed and the older procedure stopped to work.
The recent update of MIB should have this problem fixed, at least I was able to connect to Omero demo server from Matlab (Win/Mac) and from compiled versions (Win/Mac)

Ilya

Hi Ilya,

Thanks much for making the new version of MIB compatible with OMERO 5.5.x. Works great in my initial tests and I look forward checking out all the new 2.6 features.

One of our OMERO servers is still at version 5.4.10 and MIB 2.6 (deployed) will not work with that. As you explained, since there was a significant change in the OMERO.matlab package between the 5.4 series and the 5.5 series so that makes sense. Users with OMERO 5.4.x servers will probably want to stick with MIB version 2.511. I confirmed that that continues to work fine.

Next I’ll investigate how to upload segmentation results from MIB to the OMERO server using the OMERO.matlab API tools.

Cheers,
Damir

Hi Damir,
actually, the server incompatibility may hopefully be addressed. I can modify the procedure so that it will check for the presence of omero_client.jar. Would you be able to test that, if I implement it?
Ilya

@dsudar,
I quickly looked the code and I think the new version of MIB should be compatible with older OMERO servers, you only need to specify correct OMERO-Matlab bindings.
Ilya

Hi Ilya,

You are right and I don’t know what I did wrong yesterday. MIB 2.6 indeed works fine with either OMERO 5.5 or OMERO 5.4.x with the matching OMERO.matlab package installed and configured. Apologies for the false report.

One quick question: upon exiting MIB the console window remains open. Is that intentional?

Thanks,
Damir

@dsudar,

One quick question: upon exiting MIB the console window remains open. Is that intentional?
I have the same thing, the console window has to be closed manually. I do not really know the reason.

Thanks for confirming. It’s not a problem, I was just wondering.

Now onwards to seeing how to upload segmentation masks into OMERO. I had a quick look at the MIB GitHub repo; it’s quite a large and complex package. Do you have recommendations where to look first?

Thanks,
Damir

Hi Damir,
The connection to OMERO is handled in @mibImportOmeroController. Considering the actual commands how to send datasets to OMERO, there is a nice demo example (CreateImage) on OMERO website.
The possible way to start is to encode it as a plugin, you can use a template in Development/mibPluginGUI_ver3_appDesigner/mibPluginController.m there is also a doc-file with instructions. Within plugin it is possible to acquire the model/mask dataset as
M = obj.mibModel.getData4D('model');
or
M = obj.mibModel.getData4D('mask');
and send the dataset in M variable to OMERO.
From my quick look of OMERO I did not find any special way of storing models, i.e. it seems that they have to be uploaded as normal datasets, but extended with some annotations that should specify material names and their colors.
But since we do not use (yet) OMERO, I can’t really say what is the best way to upload/update datasets.
Ilya

Hi Ilya,

If I understand the concept of the models within MIB correctly, those could readily be represented as ROIs within OMERO (https://docs.openmicroscopy.org/ome-model/6.0.0/developers/roi.html). Especially mask shapes could each represent a material in a MIB model and be given the material name and other attributes such as color, transparency, etc. And such a set of ROIs would be displayed as an overlay over the original image. So I was wondering whether it would make sense to have an output to OMERO be done that way similar to how a MIB model can be “exported” to Matlab or Imaris. The OMERO.matlab package has bindings for that: https://docs.openmicroscopy.org/omero/5.5.1/developers/Matlab.html#rois (the example doesn’t show hoe to generate mask ROIs but I presume it’s very similar to how it’s done in Python - https://docs.openmicroscopy.org/omero/5.5.1/developers/Python.html#rois).

If you think that approach makes sense, I’ll give it a try.

Thanks,
Damir