loci.formats.in.LeicaMicrosystemsMetadata

## Class LMSMetadataExtractor

- java.lang.Object
- - loci.formats.in.LeicaMicrosystemsMetadata.LMSMetadataExtractor

-     public class LMSMetadataExtractor
      extends java.lang.Object

  This class extracts metadata information from Leica Microsystems image XML and stores it in the reader's CoreMetadata and MetadataTempBuffer
  Author:
    Melissa Linkert melissa at glencoesoftware.com, Constanze Wendlandt constanze.wendlandt at leica-microsystems.com

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) java.util.List<java.lang.Long>` | `channelBytesIncs`
    `(package private) int` | `extras`
    `private static long` | `METER_MULTIPLY`
    `private LMSFileReader` | `r`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LMSMetadataExtractor(LMSFileReader reader)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addUserCommentMeta(org.w3c.dom.Element imageNode, int image)` Extracts user comments and adds them to the reader's `CoreMetadata`
    `private org.w3c.dom.NodeList` | `getChannelDescriptionNodes(org.w3c.dom.Element root)`
    `static int` | `getChannelIndex(org.w3c.dom.Element filterSetting)`
    `private int` | `getChannelPriority(java.lang.String lutName)`
    `private org.w3c.dom.NodeList` | `getDimensionDescriptionNodes(org.w3c.dom.Element root)`
    `private org.w3c.dom.Element` | `getImageDescription(org.w3c.dom.Element root)`
    `private org.w3c.dom.NodeList` | `getNodes(org.w3c.dom.Element root, java.lang.String nodeName)` Returns all (grand*n)children nodes with given node name
    `double` | `parseDouble(java.lang.String value)`
    `int` | `parseInt(java.lang.String value)`
    `long` | `parseLong(java.lang.String value)`
    `private void` | `populateOriginalMetadata(org.w3c.dom.Element root, java.util.Deque<java.lang.String> nameStack)` Creates key value pairs from attributes of the root's child nodes (tag | attribute name : attribute value) and adds them to reader's `CoreMetadata`
    `private void` | `setCoreDimensionSizes(int coreIndex)` Writes extracted dimension sizes to CoreMetadata
    `private void` | `setPixelType(int coreIndex)` Sets CoreMetadata.pixelType depending on extracted x bytesInc
    `void` | `translateAttachmentNodes(org.w3c.dom.Element imageNode, int image)` Extracts information from dimension descriptions and writes it to reader's `MetadataTempBuffer`
    `void` | `translateChannelDescriptions(org.w3c.dom.Element imageNode, int coreIndex)` Extracts i.a.
    `void` | `translateDetectors(org.w3c.dom.Element imageNode, int image)` Extracts detector information and writes it to reader's `MetadataTempBuffer`
    `private void` | `translateDimensionDescriptions(org.w3c.dom.Element imageNode, int coreIndex)` Extracts information from dimension descriptions and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
    `void` | `translateFilterSettings(org.w3c.dom.Element imageNode, int image)` Extracts filter information and writes it to reader's `MetadataTempBuffer`
    `void` | `translateImage(org.w3c.dom.Element image, int i)` Extracts information from element node and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
    `void` | `translateLaserLines(org.w3c.dom.Element imageNode, int image)` Extracts laser information and writes it to reader's `MetadataTempBuffer`
    `private ome.xml.model.primitives.Color` | `translateLut(java.lang.String lutName)` Translates Leica XML lut name / value to Color
    `private void` | `translateLuts(java.util.List<java.lang.String> luts, int imgIndex)` Translates raw channel luts of an image to Colors and writes it to reader's `MetadataTempBuffer`
    `void` | `translateMetadata(java.util.List<LMSImageXmlDocument> docs)` Extracts all information from Leica image xml Documents and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
    `void` | `translateROIs(org.w3c.dom.Element imageNode, int image)` Extracts ROIs and writes them to reader's `MetadataTempBuffer`
    `void` | `translateScannerSettings(org.w3c.dom.Element imageNode, int image)` Extracts scanner information and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
    `void` | `translateSingleROIs(org.w3c.dom.Element imageNode, int image)` Extracts single ROIs and writes them to reader's `MetadataTempBuffer`
    `private double` | `translateSingleTimestamp(org.w3c.dom.Element timestamp)` Translates the content of a timestamp node to double value
    `private double` | `translateSingleTimestamp(java.lang.String timestamp)` Translates hex timestamp string to double value
    `void` | `translateTimestamps(org.w3c.dom.Element imageNode, int image)` Extracts timestamps and writes them to reader's `MetadataTempBuffer`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### METER_MULTIPLY

          private static final long METER_MULTIPLY

      See Also:
        Constant Field Values

    - #### r

          private LMSFileReader r

    - #### channelBytesIncs

          java.util.List<java.lang.Long> channelBytesIncs

    - #### extras

          int extras

  - ### Constructor Detail

    - #### LMSMetadataExtractor

          public LMSMetadataExtractor(LMSFileReader reader)

  - ### Method Detail

    - #### translateMetadata

          public void translateMetadata(java.util.List<LMSImageXmlDocument> docs)
                                 throws FormatException,
                                        java.io.IOException

      Extracts all information from Leica image xml Documents and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
      Parameters:
        `docs` - list of Leica xml documents
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### translateImage

          public void translateImage(org.w3c.dom.Element image,
                                     int i)
                              throws FormatException

      Extracts information from element node and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
      Parameters:
        `img` - node with tag name "element" from Leica XML
        `i` - image /core index
      Throws:
        `FormatException`

    - #### translateChannelDescriptions

          public void translateChannelDescriptions(org.w3c.dom.Element imageNode,
                                                   int coreIndex)
                                            throws FormatException

      Extracts i.a. channel number and luts from channel descriptions and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `coreIndex` -
      Throws:
        `FormatException`

    - #### translateLuts

          private void translateLuts(java.util.List<java.lang.String> luts,
                                     int imgIndex)

      Translates raw channel luts of an image to Colors and writes it to reader's `MetadataTempBuffer`
      Parameters:
        `luts` - list of raw lut names / values from Leica XML

    - #### getChannelPriority

          private int getChannelPriority(java.lang.String lutName)

    - #### translateLut

          private ome.xml.model.primitives.Color translateLut(java.lang.String lutName)

      Translates Leica XML lut name / value to Color
      Parameters:
        `lutName` -
      Returns:

    - #### translateDimensionDescriptions

          private void translateDimensionDescriptions(org.w3c.dom.Element imageNode,
                                                      int coreIndex)
                                               throws FormatException

      Extracts information from dimension descriptions and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `coreIndex` -
      Throws:
        `FormatException`

    - #### setCoreDimensionSizes

          private void setCoreDimensionSizes(int coreIndex)

      Writes extracted dimension sizes to CoreMetadata
      Parameters:
        `coreIndex` -

    - #### setPixelType

          private void setPixelType(int coreIndex)
                             throws FormatException

      Sets CoreMetadata.pixelType depending on extracted x bytesInc
      Parameters:
        `coreIndex` -
      Throws:
        `FormatException`

    - #### translateAttachmentNodes

          public void translateAttachmentNodes(org.w3c.dom.Element imageNode,
                                               int image)
                                        throws FormatException

      Extracts information from dimension descriptions and writes it to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateScannerSettings

          public void translateScannerSettings(org.w3c.dom.Element imageNode,
                                               int image)
                                        throws FormatException

      Extracts scanner information and writes it to reader's `CoreMetadata` and `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateFilterSettings

          public void translateFilterSettings(org.w3c.dom.Element imageNode,
                                              int image)
                                       throws FormatException

      Extracts filter information and writes it to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateTimestamps

          public void translateTimestamps(org.w3c.dom.Element imageNode,
                                          int image)
                                   throws FormatException

      Extracts timestamps and writes them to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateLaserLines

          public void translateLaserLines(org.w3c.dom.Element imageNode,
                                          int image)
                                   throws FormatException

      Extracts laser information and writes it to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateROIs

          public void translateROIs(org.w3c.dom.Element imageNode,
                                    int image)
                             throws FormatException

      Extracts ROIs and writes them to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateSingleROIs

          public void translateSingleROIs(org.w3c.dom.Element imageNode,
                                          int image)
                                   throws FormatException

      Extracts single ROIs and writes them to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateDetectors

          public void translateDetectors(org.w3c.dom.Element imageNode,
                                         int image)
                                  throws FormatException

      Extracts detector information and writes it to reader's `MetadataTempBuffer`
      Parameters:
        `imageNode` - Image node from Leica xml
        `image` - image / core index
      Throws:
        `FormatException`

    - #### translateSingleTimestamp

          private double translateSingleTimestamp(java.lang.String timestamp)

      Translates hex timestamp string to double value
      Parameters:
        `timestamp` - timestamp in format
      Returns:
        number of seconds

    - #### translateSingleTimestamp

          private double translateSingleTimestamp(org.w3c.dom.Element timestamp)

      Translates the content of a timestamp node to double value
      Parameters:
        `imageNode` - timestamp node
        `image` - image / core index
      Throws:
        `FormatException`

    - #### addUserCommentMeta

          private void addUserCommentMeta(org.w3c.dom.Element imageNode,
                                          int image)
                                   throws FormatException

      Extracts user comments and adds them to the reader's `CoreMetadata`
      Parameters:
        `imageNode` -
        `image` -
      Throws:
        `FormatException`

    - #### populateOriginalMetadata

          private void populateOriginalMetadata(org.w3c.dom.Element root,
                                                java.util.Deque<java.lang.String> nameStack)

      Creates key value pairs from attributes of the root's child nodes (tag | attribute name : attribute value) and adds them to reader's `CoreMetadata`
      Parameters:
        `root` - xml node
        `nameStack` - list of node names to be prepended to key name

    - #### parseLong

          public long parseLong(java.lang.String value)

    - #### parseInt

          public int parseInt(java.lang.String value)

    - #### parseDouble

          public double parseDouble(java.lang.String value)

    - #### getImageDescription

          private org.w3c.dom.Element getImageDescription(org.w3c.dom.Element root)

    - #### getChannelDescriptionNodes

          private org.w3c.dom.NodeList getChannelDescriptionNodes(org.w3c.dom.Element root)

    - #### getDimensionDescriptionNodes

          private org.w3c.dom.NodeList getDimensionDescriptionNodes(org.w3c.dom.Element root)

    - #### getNodes

          private org.w3c.dom.NodeList getNodes(org.w3c.dom.Element root,
                                                java.lang.String nodeName)

      Returns all (grand*n)children nodes with given node name
      Parameters:
        `root` - root node
        `nodeName` - name of children that shall be searched
      Returns:
        list of child nodes with given name

    - #### getChannelIndex

          public static int getChannelIndex(org.w3c.dom.Element filterSetting)

Copyright © 2026 Open Microscopy Environment