We're Hiring!

Geting sample structure info in MatLab

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Geting sample structure info in MatLab

Postby drone-fly » Tue Aug 06, 2013 3:47 am

Hello,
I'm working with oib and oif files in MatLab, and I want to know sample structure information ( TimeIncrement ).
I found this, but it's only for ImageJ:

<?xml version="1.0" encoding="UTF-8"?>
<OME:OME xmlns:ROI="http://www.openmicroscopy.org/Schemas/ROI/2013-06"
xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2013-06"
xmlns:BIN="http://www.openmicroscopy.org/Schemas/BinaryFile/2013-06"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06
http://www.openmicroscopy.org/Schemas/O ... 06/ome.xsd">

<OME:Image ID="Image:0" Name="Series 1">
<OME:AcquisitionDate>2008-02-06T13:43:19</OME:AcquisitionDate>
<OME:Description>An example OME compliant file, based on Olympus.oib</OME:Description>
<OME:Pixels DimensionOrder="XYCZT" ID="Pixels:0"
PhysicalSizeX="0.207" PhysicalSizeY="0.207"
SizeC="3" SizeT="16" SizeX="1024" SizeY="1024" SizeZ="1"
TimeIncrement="120.1302" Type="uint16">
<OME:Channel EmissionWavelength="523" ExcitationWavelength="488" ID="Channel:0:0"
IlluminationType="Epifluorescence" Name="CH1" SamplesPerPixel="1"
PinholeSize="103.5" AcquisitionMode="LaserScanningConfocalMicroscopy"/>
<OME:Channel EmissionWavelength="578" ExcitationWavelength="561" ID="Channel:0:1"
IlluminationType="Epifluorescence" Name="CH3" SamplesPerPixel="1"
PinholeSize="127.24" AcquisitionMode="LaserScanningConfocalMicroscopy"/>
<OME:Channel ExcitationWavelength="488" ID="Channel:0:2"
IlluminationType="Transmitted"
ContrastMethod="DIC" Name="TD1" SamplesPerPixel="1"
AcquisitionMode="LaserScanningConfocalMicroscopy"/>
<BIN:BinData BigEndian="false" Length="0"/>
</OME:Pixels>
</OME:Image>

</OME:OME>

How can I get imformation about TimeIncrement using MatLab? :oops:
Thank you!
drone-fly
 
Posts: 3
Joined: Tue Aug 06, 2013 3:35 am

Re: Geting sample structure info in MatLab

Postby sbesson » Tue Aug 06, 2013 8:24 am

Good morning,

using bfopen, you should be able to retrieve the time increment of each series using

Code: Select all
data = bfopen(path_to_oif_file);
t1 = data{1,4}.getPixelsTimeIncrement(0); % Time increment of the first series
t2 = data{1,4}.getPixelsTimeIncrement(1); % Time increment of the second series if multi-series file


Alternately, if you don't want to download the raw data but only access the metadata, you can use bfGetReader to achieve the same purpose

Code: Select all
r = bfGetReader(path_to_oif_file);
t1 = r.getMetadataStore().getPixelsTimeIncrement(0); % Time increment of the first series
t2 = r.getMetadataStore().getPixelsTimeIncrement(1); % Time increment of the second series if multi-series file


Cheers,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Geting sample structure info in MatLab

Postby drone-fly » Tue Aug 06, 2013 8:35 am

But then I recive Time incrisment in frames.
Do you know, is any possibility to get Time incrisment in time( e.g. ms)
Thank you for your help!
drone-fly
 
Posts: 3
Joined: Tue Aug 06, 2013 3:35 am

Re: Geting sample structure info in MatLab

Postby sbesson » Tue Aug 06, 2013 2:31 pm

Hi again,

The TimeIncrement should be formatted in real units (seconds).
Could you check the full OME-XML metadata generated by Matlab using either

Code: Select all
xmlMetadata = char(data{1,4}.dumpXML());


or from the reader

Code: Select all
xmlMetadata = char(r.getMetadataStore().dumpXML());
.

This command should produce you the same output as the one you get in Fiji. If the output is different, we may need the original file which you can upload at http://qa.openmicroscopy.org.uk/qa/upload/.
Else, can you paste an example of the code you use to retrieve the time increment?

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Geting sample structure info in MatLab

Postby drone-fly » Wed Aug 07, 2013 1:15 am

Dear Sebastien,
Thank you very much for your help!
I find the solution, and get time real units.
drone-fly
 
Posts: 3
Joined: Tue Aug 06, 2013 3:35 am


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest