<div dir="ltr"><div>Hi Melissa,<br><br></div><div>thank you for your reply. I managed to use the commands you recommended. It, also, helped me to look at an m-file by Sebastien Besson (<a href="https://gist.github.com/sbesson/6529406">https://gist.github.com/sbesson/6529406</a>) to learn how to use the commands. However, I still have some problems. Maybe I still do not understand how to call the right plane with the right index.<br><br><br></div><div>What I need to do is to retrieve the positions of the multipoints in an nd2 file in order to know how to stitch them together.<br></div><div>I have nd2 files with 120 multipoints, several time-points and 2-3 channels.<br></div><div>I usually only retrieve the positions of the first time-point, since each multipoint should be at the same position at following times. In my first e-mail I outlined how to retrieve positions using the entries from r.getGlobalMetadata().<br></div><div>Now I tried the same using the commands you gave me:<br></div><div><br></div><div>r.setMetadataStore(loci.formats.MetadataTools.createOMEXMLMetadata());<br></div><div>r.setID();<br>metadata = r.getMetadataStore();<br>planeIndex=0;<br>for positionIndex=1:120<br> xPosition(i) = metadata.getPlanePositionX(positionIndex, planeIndex);<br> yPosition(i) = metadata.getPlanePositionY(positionIndex, planeIndex);<br></div><div>end<br><br></div><div>However, I do not get the expected positions. For clarity I attach plots of the x and y positions retrieved with versions 5.0.3 and 5.0.4 and also the expected plot retrieved via my old method with version 5.0.3 and another plot with wrong positions retrieved with my old method and version 5.0.4.<br><br></div><div>I know that I should get a pattern like in the lower left plot that I attached. Can you help me once more how to call the correct positions? I understand that the positionIndex should be the index for differnt multipoints, but how does the planeIndex look like for different time-points and channels?<br><br></div><div>The next bit is not as important to me, but still with regards to the PFS status: PFS offset and state are not quite sufficient for me. During my experiments the PFS often fails to correct to the proper position and resultingly there can be different status returns indicating if the PFS was switched off, still searching, not finding, or actually finding the correct z-position (maybe there are even more status possibilities, from the top of my head I know that 0,1,5 and 7 are possible values). With NIS elements I can take a look at those status values for each image to see what went wrong. It would be nice if this information was to be retrieved by bioformats, too. Also, I often have differnt PFS offsets, e.g. at different multipoints. Hence, a single PFS offset value for the entire experiment does not tell me too much.<br><br><br></div><div>Many thanks,<br>Enno<br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 9, 2014 at 12:23 AM, Melissa Linkert <span dir="ltr"><<a href="mailto:melissa@glencoesoftware.com" target="_blank">melissa@glencoesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Enno,<br>
<span class=""><br>
> I use bioformats.jar with Matlab to read in ND2 files. Previously I used a<br>
> 5.0.0-DEV version of loci_tools.<br>
> With bioformats I have some problems to retrieve meta data from ND2 files.<br>
> With 5.0.3 I can successfully read x,y,z position data, but with 5.0.4 I<br>
> get some discrepancies.<br>
> With both bioformat versions I fail to get the time values of each image.<br>
> However, with loci_tools I was able to do this.<br>
><br>
> Below is my current approach to read meta data from an ND2 file. Maybe<br>
> someone can point out to me how to do this differently, or how to fix the<br>
> code I use?<br>
<br>
</span>The best way to retrieve the stage position and timestamp data is as<br>
follows:<br>
<br>
%%%<br>
% positionIndex selects which multipoint to use (starting from 0)<br>
% planeIndex selects the image in the chosen multipoint (starting from 0)<br>
metadata = r.getMetadataStore();<br>
xPosition = r.getPlanePositionX(positionIndex, planeIndex);<br>
timestamp = r.getPlaneDeltaT(positionIndex, planeIndex);<br>
acquisitionStart = r.getImageAcquisitionDate(positionIndex);<br>
%%%<br>
<br>
'xPosition' will be the stage position along X; the Y and Z positions<br>
can be retrieved using similar calls to getPlanePositionY and<br>
getPlanePositionZ. 'timestamp' is the time in seconds from the<br>
beginning of acquisition ('acquisitionStart'). See also:<br>
<br>
<a href="http://downloads.openmicroscopy.org/bio-formats/5.0.4/api/ome/xml/meta/MetadataRetrieve.html" target="_blank">http://downloads.openmicroscopy.org/bio-formats/5.0.4/api/ome/xml/meta/MetadataRetrieve.html</a><br>
<a href="http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2013-06/ome_xsd.html#Plane" target="_blank">http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2013-06/ome_xsd.html#Plane</a><br>
<br>
getGlobalMetadata and getSeriesMetadata are provided for informational<br>
purposes, but are not necessarily guaranteed to have the same key/value<br>
mappings between releases.<br>
<span class=""><br>
> Also, is it possible to retrieve the PFS status of each image plane from an<br>
> ND2 file?<br>
<br>
</span>PFS status is not included in the OME data model; from the files we<br>
have, it looks like the "PFS, State" and "PFS, Offset" keys in the<br>
global metadata table will show the state and offset. If that doesn't work,<br>
though, please let us know.<br>
<br>
Regards,<br>
-Melissa<br>
<div><div class="h5"><br>
On Thu, Sep 04, 2014 at 06:09:16PM +0200, Enno R. Oldewurtel wrote:<br>
> Dear all,<br>
><br>
> I use bioformats.jar with Matlab to read in ND2 files. Previously I used a<br>
> 5.0.0-DEV version of loci_tools.<br>
> With bioformats I have some problems to retrieve meta data from ND2 files.<br>
> With 5.0.3 I can successfully read x,y,z position data, but with 5.0.4 I<br>
> get some discrepancies.<br>
> With both bioformat versions I fail to get the time values of each image.<br>
> However, with loci_tools I was able to do this.<br>
><br>
> Below is my current approach to read meta data from an ND2 file. Maybe<br>
> someone can point out to me how to do this differently, or how to fix the<br>
> code I use?<br>
> Also, is it possible to retrieve the PFS status of each image plane from an<br>
> ND2 file?<br>
><br>
><br>
> I used to retrieve e.g the x-position of a specific plane from an ND2 file<br>
> in the following way:<br>
><br>
> raw=r.getGlobalMetadata();<br>
> x=raw.get('X position for position #00083');<br>
> This is for an ND2 file with 82 timepoints, 2 channels and 120 multipoints,<br>
> i.e. the highest index was #09840 (for some reason I had to assume<br>
> 82*120*2channels as the highest index for zero padding, starting from<br>
> #09841 to #19680 all values are identical)<br>
><br>
> However, with bioformats 5.0.4 this gives me the x-value of the first<br>
> time-point instead of the 83rd. Similarly, in another experiment with 65<br>
> timepoints, the string 'X position for position #00066' gives me again the<br>
> value of the first time-point instead of the 66th.<br>
><br>
> Is this a bug in the new 5.0.4 version? I think this happened to me before<br>
> with some loci_tools version, but in a later version my approach worked<br>
> again. For bioformats 5.0.3 I can retrieve the mentioned x positions just<br>
> fine.<br>
><br>
> I also need to retrieve the time data for each image. I used to work with<br>
> loci_tools (daily built from 6th September 2013) with<br>
> rawSeries=r.getSeriesMetadata();<br>
> t=rawSeries.get('timestamp #0001')<br>
> (less zero-padding was needed, as this time the highest index was<br>
> 82*120=9840, also getSeriesMetadata is used since getMetadata takes very<br>
> long to load)<br>
><br>
> This worked fine, but since there were some bug fixes for ND2 files and<br>
> r.setID() runs significantly faster, I would like to stay with bioformats<br>
> instead of loci_tools.<br>
><br>
><br>
> Best regards,<br>
> Enno<br>
><br>
><br>
> --<br>
> Enno R. Oldewurtel<br>
> AG Prof. B. Maier / Biophysics Group<br>
> Biozentrum<br>
> Universitaet zu Koeln<br>
> Zuelpicher Str. 47b<br>
> 50674 Koeln<br>
><br>
> <a href="mailto:enno.oldewurtel@uni-koeln.de">enno.oldewurtel@uni-koeln.de</a><br>
> Tel: <a href="tel:%2B49-221-470-8048" value="+492214708048">+49-221-470-8048</a><br>
> Fax: <a href="tel:%2B49-221-470-6230" value="+492214706230">+49-221-470-6230</a><br>
> <a href="http://www.biophysics.uni-koeln.de/" target="_blank">http://www.biophysics.uni-koeln.de/</a><br>
<br>
</div></div>> _______________________________________________<br>
> ome-users mailing list<br>
> <a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a><br>
> <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Enno R. Oldewurtel<br>AG Prof. B. Maier / Biophysics Group<br>Biozentrum<br>Universitaet zu Koeln<br>Zuelpicher Str. 47b<br>50674 Koeln<br><br><a href="mailto:enno.oldewurtel@uni-koeln.de" target="_blank">enno.oldewurtel@uni-koeln.de</a><br>Tel: +49-221-470-8048<br>Fax: +49-221-470-6230<br><a href="http://www.biophysics.uni-koeln.de/" target="_blank">http://www.biophysics.uni-koeln.de/</a>
</div></div>