Page 1 of 1

Geting sample structure info in MatLab

PostPosted: Tue Aug 06, 2013 3:47 am
by drone-fly
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!

Re: Geting sample structure info in MatLab

PostPosted: Tue Aug 06, 2013 8:24 am
by sbesson
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

Re: Geting sample structure info in MatLab

PostPosted: Tue Aug 06, 2013 8:35 am
by drone-fly
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!

Re: Geting sample structure info in MatLab

PostPosted: Tue Aug 06, 2013 2:31 pm
by sbesson
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

Re: Geting sample structure info in MatLab

PostPosted: Wed Aug 07, 2013 1:15 am
by drone-fly
Dear Sebastien,
Thank you very much for your help!
I find the solution, and get time real units.