Troubles Matlab, image export, different metadata

Hey people,

I have a standing Matlab script for my images and just lately decided to switch to omero. So right now I’m working on reworking my standing scripts into scripts which can crawl the image data I used to have in my local result-directories and push back analysis results (most of the time values like t_half or tau values, but also ROIs etc.) to the omero database.
So I aim for continuing my Matlab analysis how it is - but end up with a nicely files omero data bank where every image has it’s analysis values as meta data.

From what I got from reading through the manuals and trying the training material I’m also pretty sure that this is possible to do - and I tought I would somehow have the idea how to do it.

But with the part of file download and to I ran into troubles I wasn’t able to solve for some weeks now. I hope my request is not redundant and understandable. I’ll be happy to contribute all the missing information!

So I’m working with image data from a confocal - so stacked images from imaging over time. I upload the data in .lif format to my omero server.
What I need as input for my analysis script is those stacks in tiff format.

What I have archived so far is to figure out, how I can crawl the data sets of interest. What I now want is that matlab can read the image and run the analysis with it and push the calculated values back after that. (Later I also have a python script which would use those values to make plots - just in case that’s important but would be another topic anyways.).

I started with a way where I download the file as a OME.tiff file and converting it with bfconvert to a tiff file (I need this step because my script was written for the tif format and will not work with ome.tiff). My previous way was to convert my .lif file to the tif file using Fiji.
Processing worked nicely so far.

But then I discovered that the metadata of the tif file I converted from OME.tif is slightly differnet than the information I got from the conversion with FIJI.
In this particular case the information of the time between the stack images is missing.

Firstly I was wondering if this information is maybe stored in the xml file of the ome.tiff? But where do I find this, when I use bfconvert? Sorry, I wasn’t able to understand those connetions completely while reading the docs.

Then I wondered why there is a difference in the metadata information in general? (just a question of interest)

In the next step I was thinking if I can work around my problem with using the FIJI implementation with Matlab and got back to download the lif files from the omero server and convert it localy with FIJI again. But I have massive strugles with setting this up.
That’s why I came back to think about what probably the better practice would be to solve this issue.
And I really hope to find some help here.

Besides the questions above I would like to ask some more general questions:

Is this the right way at all to think about downloading the single files localy, doing the analysis, pushing the result values back and probably delete the local file again afterwards?
Or is there a way where I can skip the downloading process and run the matlab-analysis script on the images on the server? As far as I understood this is somehow the way the python analyses would work?

What would be the correct way to access the meta data with matlab in order to be able to work with it?

I’m really eager to set up omero as a work environment for my project. But I think I got a bit lost in it’s complexity working together with the language implementations (which is in general just awesome to have btw.)
I would be incredibly thankful for some guidance through this process. Pls let me know if any code parts will help to understand my process.

All the best
Vic

Hi @vcfbnn,

What I have archived so far is to figure out, how I can crawl the data sets of interest. What I now want is that matlab can read the image and run the analysis with it and push the calculated values back after that

I have not tried to upload metadata to the OMERO server, but we have a routine in MIB that can load images (or their parts) from Omero servers, you can check “continueBtn_Callback” in mibImportOmeroController.m.

What would be the correct way to access the meta data with matlab in order to be able to work with it?

the function above gets also voxel size and time step, so you can check the way how it is performed.

You have many points in your post, but probably someone from Omero team can address those. I would try to minumize number of programs used. For example, you can process you original LIF images in Matlab using Bio-Format reader and upload them and the results of analysis to Omero server.

Hi Ilya, thanks for your answer!

This sounds, if this is what I’m looking for! I’ll try it out, thanks!

Yes - that’s exactly what I’m aiming for. I included the Bio-formats package into my Omero-Matlab directory.
Here I wasn’t able to figure out how I can bfopen() when I don’t have downloaded the image before. That’s came along the way that I have to download it with exportImageAsOMETIFF(), convert and open it.

Did I missed something in the documentation regarding an option using bio-formats reader in matlab?

Here I wasn’t able to figure out how I can bfopen() when I don’t have downloaded the image before.

Sorry, I was not clear enough. I was referring to a situation, when you still have lif-images locally; so you can upload them to omero, but at the same time process the way you want. I don’t think bfopen can get get images directly from the sever.
If you want to use the server part (there are obvious reasons why), just grab the required dataset from omero, process and upload the results back.