Adding Magnification Data to XML File Extracted From OME TIFF File

I’m trying to use the bio-formats tools on the command line and I have extracted the XML metadata from an OME TIFF file that I converted from a png file. The XML text itself is attached below as a reference. I’m trying to attach more information to the metadata including the magnification of the microscope that’s being used, but I’m having trouble doing so. Any advice on how to add that and extra information would be appreciated.

Sorry in advance if this post doesn’t meet the requirements of the forum, I’m new both to the image.sc forum and the image analysis field.

Thank you,
Richard

Hi @richardjo,

A good start would probably be comparing with the XML in some of the sample files at https://docs.openmicroscopy.org/ome-model/6.0.0/ome-tiff/data.html, for example the tubhiswt-3D dataset contains an example of Instrument with magnification:

   <Instrument ID="urn:lsid:loci.wisc.edu:Instrument:OWS1">
      <Microscope Manufacturer="Nikon" Model="Eclipse TE300" SerialNumber="U629762" Type="Inverted"/>
      <Laser ID="urn:lsid:loci.wisc.edu:LightSource:OWS1" LaserMedium="TiSapphire" Manufacturer="Spectral Physics" Model="Tsunami 5W" SerialNumber="2123" Type="SolidState"/>
      <Detector ID="urn:lsid:loci.wisc.edu:Detector:OWS1" Manufacturer="Hamamatzu" Model="H7422" Type="PMT"/>
      <Detector ID="urn:lsid:loci.wisc.edu:Detector:OWS2" Manufacturer="Bio-Rad" Model="1024TLD" Type="Photodiode"/>
      <Objective CalibratedMagnification="100.0" Correction="PlanApo" ID="urn:lsid:loci.wisc.edu:Objective:OWS2" Immersion="Oil" LensNA="1.4" Manufacturer="Nikon" Model="S Fluor" NominalMagnification="100.0" SerialNumber="044989" WorkingDistance="0.13" WorkingDistanceUnit="µm"/>
   </Instrument>

If you need to delve deeper then the OME-TIFF spec is available at https://docs.openmicroscopy.org/ome-model/6.0.0/ome-tiff/specification.html# and the OME Model schema is available at https://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd

If you are then looking to replace the original XML with your modified version you can use the tiffcomment command line tool, see https://docs.openmicroscopy.org/bio-formats/6.2.1/users/comlinetools/edit.html

1 Like

Do you know why this was included as part of the metadata?

Hi @richardjo

assuming you are referring to the format of the instrument identifier, it is an implementation of Life Science Identifiers - see this page for more information.

Support for LSID has been introduced in early versions of the OME model and the thubhiswt sample dataset was created using this convention a decade ago and upgraded for each version of the model, preserving the original format.
No significant work has been made on LSID since. It is fair to assume that the large majority of OME-XML samples simply use the <Element>:<id> identifier format these days e.g.:

   <Instrument ID="Instrument:0">
      <Microscope Manufacturer="Nikon" Model="Eclipse TE300" SerialNumber="U629762" Type="Inverted"/>
      <Laser ID="LightSource:0" LaserMedium="TiSapphire" Manufacturer="Spectral Physics" Model="Tsunami 5W" SerialNumber="2123" Type="SolidState"/>
      <Detector ID="Detector:0" Manufacturer="Hamamatzu" Model="H7422" Type="PMT"/>
      <Detector ID="Detector:1" Manufacturer="Bio-Rad" Model="1024TLD" Type="Photodiode"/>
      <Objective CalibratedMagnification="100.0" Correction="PlanApo" ID="Objective:0" Immersion="Oil" LensNA="1.4" Manufacturer="Nikon" Model="S Fluor" NominalMagnification="100.0" SerialNumber="044989" WorkingDistance="0.13" WorkingDistanceUnit="µm"/>
   </Instrument>

Hope this answers your question but please let me know if I misunderstood it :slight_smile:

1 Like