[ome-users] ND2 meta data with bioformats 5.0.4

Melissa Linkert melissa at glencoesoftware.com
Mon Sep 8 23:23:04 BST 2014


Hi Enno,

> I use bioformats.jar with Matlab to read in ND2 files. Previously I used a
> 5.0.0-DEV version of loci_tools.
> With bioformats I have some problems to retrieve meta data from ND2 files.
> With 5.0.3 I can successfully read x,y,z position data, but with 5.0.4 I
> get some discrepancies.
> With both bioformat versions I fail to get the time values of each image.
> However, with loci_tools I was able to do this.
> 
> Below is my current approach to read meta data from an ND2 file. Maybe
> someone can point out to me how to do this differently, or how to fix the
> code I use?

The best way to retrieve the stage position and timestamp data is as
follows:

%%%
% positionIndex selects which multipoint to use (starting from 0)
% planeIndex selects the image in the chosen multipoint (starting from 0)
metadata = r.getMetadataStore();
xPosition = r.getPlanePositionX(positionIndex, planeIndex);
timestamp = r.getPlaneDeltaT(positionIndex, planeIndex);
acquisitionStart = r.getImageAcquisitionDate(positionIndex);
%%%

'xPosition' will be the stage position along X; the Y and Z positions
can be retrieved using similar calls to getPlanePositionY and
getPlanePositionZ.  'timestamp' is the time in seconds from the
beginning of acquisition ('acquisitionStart').  See also:

http://downloads.openmicroscopy.org/bio-formats/5.0.4/api/ome/xml/meta/MetadataRetrieve.html
http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2013-06/ome_xsd.html#Plane

getGlobalMetadata and getSeriesMetadata are provided for informational
purposes, but are not necessarily guaranteed to have the same key/value
mappings between releases.

> Also, is it possible to retrieve the PFS status of each image plane from an
> ND2 file?

PFS status is not included in the OME data model; from the files we
have, it looks like the "PFS, State" and "PFS, Offset" keys in the
global metadata table will show the state and offset.  If that doesn't work,
though, please let us know.

Regards,
-Melissa

On Thu, Sep 04, 2014 at 06:09:16PM +0200, Enno R. Oldewurtel wrote:
> Dear all,
> 
> I use bioformats.jar with Matlab to read in ND2 files. Previously I used a
> 5.0.0-DEV version of loci_tools.
> With bioformats I have some problems to retrieve meta data from ND2 files.
> With 5.0.3 I can successfully read x,y,z position data, but with 5.0.4 I
> get some discrepancies.
> With both bioformat versions I fail to get the time values of each image.
> However, with loci_tools I was able to do this.
> 
> Below is my current approach to read meta data from an ND2 file. Maybe
> someone can point out to me how to do this differently, or how to fix the
> code I use?
> Also, is it possible to retrieve the PFS status of each image plane from an
> ND2 file?
> 
> 
> I used to retrieve e.g the x-position of a specific plane from an ND2 file
> in the following way:
> 
> raw=r.getGlobalMetadata();
> x=raw.get('X position for position #00083');
> This is for an ND2 file with 82 timepoints, 2 channels and 120 multipoints,
> i.e. the highest index was #09840 (for some reason I had to assume
> 82*120*2channels as the highest index for zero padding, starting from
> #09841 to #19680 all values are identical)
> 
> However, with bioformats 5.0.4 this gives me the x-value of the first
> time-point instead of the 83rd. Similarly, in another experiment with 65
> timepoints, the string 'X position for position #00066' gives me again the
> value of the first time-point instead of the 66th.
> 
> Is this a bug in the new 5.0.4 version? I think this happened to me before
> with some loci_tools version, but in a later version my approach worked
> again. For bioformats 5.0.3 I can retrieve the mentioned x positions just
> fine.
> 
> I also need to retrieve the time data for each image. I used to work with
> loci_tools (daily built from 6th September 2013) with
> rawSeries=r.getSeriesMetadata();
> t=rawSeries.get('timestamp #0001')
> (less zero-padding was needed, as this time the highest index was
> 82*120=9840, also getSeriesMetadata is used since getMetadata takes very
> long to load)
> 
> This worked fine, but since there were some bug fixes for ND2 files and
> r.setID() runs significantly faster, I would like to stay with bioformats
> instead of loci_tools.
> 
> 
> Best regards,
> Enno
> 
> 
> -- 
> Enno R. Oldewurtel
> AG Prof. B. Maier / Biophysics Group
> Biozentrum
> Universitaet zu Koeln
> Zuelpicher Str. 47b
> 50674 Koeln
> 
> enno.oldewurtel at uni-koeln.de
> Tel: +49-221-470-8048
> Fax: +49-221-470-6230
> http://www.biophysics.uni-koeln.de/

> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users




More information about the ome-users mailing list