loci.formats.services

## Class OMEXMLServiceImpl

- java.lang.Object
- - loci.common.services.AbstractService
  - - loci.formats.services.OMEXMLServiceImpl

- All Implemented Interfaces:
    loci.common.services.Service, OMEXMLService

      public class OMEXMLServiceImpl
      extends loci.common.services.AbstractService
      implements OMEXMLService

  Author:
    callan

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `LATEST_VERSION` Latest OME-XML version namespace.
    `private static org.slf4j.Logger` | `LOGGER` Logger for this class.
    `static java.lang.String` | `NO_OME_XML_MSG`
    `private static javax.xml.transform.Templates` | `reorderXSLT` Reordering stylesheet.
    `static loci.common.xml.XMLTools.SchemaReader` | `SCHEMA_CLASSPATH_READER` Finds OME-XML schema definitions in specifications.jar.
    `private static java.lang.String` | `SCHEMA_PATH`
    `private static java.util.regex.Pattern` | `SCHEMA_URL_PATTERN` The pattern of system ID URLs for OME-XML schema definitions.
    `private static javax.xml.transform.Templates` | `update2003FC` Stylesheets for updating from previous schema releases.
    `private static javax.xml.transform.Templates` | `update200706`
    `private static javax.xml.transform.Templates` | `update200802`
    `private static javax.xml.transform.Templates` | `update200809`
    `private static javax.xml.transform.Templates` | `update200909`
    `private static javax.xml.transform.Templates` | `update201004`
    `private static javax.xml.transform.Templates` | `update201006`
    `private static javax.xml.transform.Templates` | `update201106`
    `private static javax.xml.transform.Templates` | `update201206`
    `private static javax.xml.transform.Templates` | `update201306`
    `private static javax.xml.transform.Templates` | `update201501`
    `private static java.lang.String` | `XSLT_2003FC`
    `private static java.lang.String` | `XSLT_200706`
    `private static java.lang.String` | `XSLT_200802`
    `private static java.lang.String` | `XSLT_200809`
    `private static java.lang.String` | `XSLT_200909`
    `private static java.lang.String` | `XSLT_201004`
    `private static java.lang.String` | `XSLT_201006`
    `private static java.lang.String` | `XSLT_201106`
    `private static java.lang.String` | `XSLT_201206`
    `private static java.lang.String` | `XSLT_201306`
    `private static java.lang.String` | `XSLT_201501`
    `private static java.lang.String` | `XSLT_PATH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OMEXMLServiceImpl()` Default constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMetadataOnly(OMEXMLMetadata omexmlMeta, int image)` Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.
    `void` | `addMetadataOnly(OMEXMLMetadata omexmlMeta, int image, boolean resolve)` Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.
    `void` | `addModuloAlong(OMEXMLMetadata meta, CoreMetadata core, int imageIdx)` Adds ModuloAlong* annotations to the given OME-XML metadata object, using the given CoreMetadata object to determine modulo dimensions.
    `MetadataRetrieve` | `asRetrieve(MetadataStore meta)` Gets the given `MetadataStore` object as a `MetadataRetrieve`.
    `MetadataStore` | `asStore(MetadataRetrieve meta)` Gets the given `MetadataRetrieve` object as a `MetadataStore`.
    `void` | `convertMetadata(MetadataRetrieve src, MetadataStore dest)` Copies information from a metadata retrieval object (source) into a metadata store (destination).
    `void` | `convertMetadata(java.lang.String xml, MetadataStore dest)` Converts information from an OME-XML string (source) into a metadata store (destination).
    `private void` | `createModulo(OMEXMLMetadata meta, Modulo modulo, ome.xml.model.StructuredAnnotations annotations, ome.xml.model.Image image, int imageIdx, int annotationIndex, int imageAnnotation)` Create a ModuloAlong* annotation corresponding to the given `Modulo`.
    `OMEXMLMetadata` | `createOMEXMLMetadata()` Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package.
    `OMEXMLMetadata` | `createOMEXMLMetadata(java.lang.String xml)` Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package, wrapping a DOM representation of the given OME-XML string.
    `OMEXMLMetadata` | `createOMEXMLMetadata(java.lang.String xml, java.lang.String version)` Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package, wrapping a DOM representation of the given OME-XML string.
    `ome.xml.model.OMEModelObject` | `createOMEXMLRoot(java.lang.String xml)` Constructs an OME root node.
    `private ome.xml.meta.OMEXMLMetadataRoot` | `createRoot(java.lang.String xml)` Constructs an OME root node.
    `boolean` | `equals(org.w3c.dom.Node e1, org.w3c.dom.Node e2)` Compares two Elements for equality.
    `private org.w3c.dom.Node` | `findChildWithID(org.w3c.dom.Node root, java.lang.String name, java.lang.String id)` Return the child node with specified value for the "ID" attribute.
    `private org.w3c.dom.Node` | `findRootNode(org.w3c.dom.Node child)` Return the absolute root node for the specified child node.
    `java.lang.String` | `getLatestVersion()` Retrieves the latest supported version of the OME-XML schema.
    `private Modulo` | `getModuloAlong(OMEXMLMetadata omexml, java.lang.String tag, int image)` Create a `Modulo` corresponding to the given ModuloAlong* tag.
    `Modulo` | `getModuloAlongC(OMEXMLMetadata omexml, int image)` Retrieve the ModuloAlongC annotation in the given Image in the given OME-XML metadata object.
    `Modulo` | `getModuloAlongT(OMEXMLMetadata omexml, int image)` Retrieve the ModuloAlongT annotation in the given Image in the given OME-XML metadata object.
    `Modulo` | `getModuloAlongZ(OMEXMLMetadata omexml, int image)` Retrieve the ModuloAlongZ annotation in the given Image in the given OME-XML metadata object.
    `OMEXMLMetadata` | `getOMEMetadata(MetadataRetrieve src)` Returns a `OMEXMLMetadata` object with the same contents as the given MetadataRetrieve, converting it if necessary.
    `java.lang.String` | `getOMEXML(MetadataRetrieve src)` Extracts an OME-XML metadata string from the given metadata object, by converting to an OME-XML metadata object if necessary.
    `java.lang.String` | `getOMEXMLVersion(java.lang.Object o)` Gets the schema version for the given OME-XML metadata or root object (e.g., "2007-06" or "2003-FC").
    `java.util.Hashtable` | `getOriginalMetadata(OMEXMLMetadata omexmlMeta)` Parse any OriginalMetadata annotations from the given OME-XML metadata object and store them in a Hashtable.
    `boolean` | `isEqual(OMEXMLMetadata src1, OMEXMLMetadata src2)` Determine whether or not two OMEXMLMetadata objects are equal.
    `boolean` | `isOMEXMLMetadata(java.lang.Object o)` Checks whether the given object is an OME-XML metadata object.
    `boolean` | `isOMEXMLRoot(java.lang.Object o)` Checks whether the given object is an OME-XML root object.
    `void` | `populateOriginalMetadata(OMEXMLMetadata omexmlMeta, java.util.Hashtable<java.lang.String,java.lang.Object> metadata)` Adds the key/value pairs in the specified Hashtable as new OriginalMetadata annotations in the given OME-XML metadata object.
    `void` | `populateOriginalMetadata(OMEXMLMetadata omexmlMeta, java.lang.String key, java.lang.String value)` Adds the specified key/value pair as a new OriginalMetadata node to the given OME-XML metadata object.
    `void` | `removeBinData(OMEXMLMetadata omexmlMeta)` Remove all of the BinData elements from the given OME-XML metadata object.
    `void` | `removeChannels(OMEXMLMetadata omexmlMeta, int image, int sizeC)` Remove all but the first sizeC valid Channel elements from the given OME-XML metadata object.
    `void` | `removeTiffData(OMEXMLMetadata omexmlMeta)` Remove all of the TiffData elements from the given OME-XML metadata object.
    `java.lang.String` | `transformToLatestVersion(java.lang.String xml)` Transforms the given OME-XML string to the latest supported version of of the OME-XML schema.
    `boolean` | `validateOMEXML(java.lang.String xml)` Attempts to validate the given OME-XML string using Java's XML validation facility.
    `boolean` | `validateOMEXML(java.lang.String xml, boolean pixelsHack)` Attempts to validate the given OME-XML string using Java's XML validation facility.
    `private java.lang.String` | `verifyOMENamespace(java.lang.String xml)` Ensures that an xmlns:ome element exists.

    - ### Methods inherited from class loci.common.services.AbstractService

      `checkClassDependency`

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

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

- - ### Field Detail

    - #### LATEST_VERSION

          public static final java.lang.String LATEST_VERSION

      Latest OME-XML version namespace.
      See Also:
        Constant Field Values

    - #### NO_OME_XML_MSG

          public static final java.lang.String NO_OME_XML_MSG

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      Logger for this class.

    - #### XSLT_PATH

          private static final java.lang.String XSLT_PATH

      See Also:
        Constant Field Values

    - #### XSLT_2003FC

          private static final java.lang.String XSLT_2003FC

      See Also:
        Constant Field Values

    - #### XSLT_200706

          private static final java.lang.String XSLT_200706

      See Also:
        Constant Field Values

    - #### XSLT_200802

          private static final java.lang.String XSLT_200802

      See Also:
        Constant Field Values

    - #### XSLT_200809

          private static final java.lang.String XSLT_200809

      See Also:
        Constant Field Values

    - #### XSLT_200909

          private static final java.lang.String XSLT_200909

      See Also:
        Constant Field Values

    - #### XSLT_201004

          private static final java.lang.String XSLT_201004

      See Also:
        Constant Field Values

    - #### XSLT_201006

          private static final java.lang.String XSLT_201006

      See Also:
        Constant Field Values

    - #### XSLT_201106

          private static final java.lang.String XSLT_201106

      See Also:
        Constant Field Values

    - #### XSLT_201206

          private static final java.lang.String XSLT_201206

      See Also:
        Constant Field Values

    - #### XSLT_201306

          private static final java.lang.String XSLT_201306

      See Also:
        Constant Field Values

    - #### XSLT_201501

          private static final java.lang.String XSLT_201501

      See Also:
        Constant Field Values

    - #### reorderXSLT

          private static javax.xml.transform.Templates reorderXSLT

      Reordering stylesheet.

    - #### update2003FC

          private static javax.xml.transform.Templates update2003FC

      Stylesheets for updating from previous schema releases.

    - #### update200706

          private static javax.xml.transform.Templates update200706

    - #### update200802

          private static javax.xml.transform.Templates update200802

    - #### update200809

          private static javax.xml.transform.Templates update200809

    - #### update200909

          private static javax.xml.transform.Templates update200909

    - #### update201004

          private static javax.xml.transform.Templates update201004

    - #### update201006

          private static javax.xml.transform.Templates update201006

    - #### update201106

          private static javax.xml.transform.Templates update201106

    - #### update201206

          private static javax.xml.transform.Templates update201206

    - #### update201306

          private static javax.xml.transform.Templates update201306

    - #### update201501

          private static javax.xml.transform.Templates update201501

    - #### SCHEMA_PATH

          private static final java.lang.String SCHEMA_PATH

      See Also:
        Constant Field Values

    - #### SCHEMA_URL_PATTERN

          private static final java.util.regex.Pattern SCHEMA_URL_PATTERN

      The pattern of system ID URLs for OME-XML schema definitions.

    - #### SCHEMA_CLASSPATH_READER

          public static final loci.common.xml.XMLTools.SchemaReader SCHEMA_CLASSPATH_READER

      Finds OME-XML schema definitions in specifications.jar.

  - ### Constructor Detail

    - #### OMEXMLServiceImpl

          public OMEXMLServiceImpl()

      Default constructor.

  - ### Method Detail

    - #### getLatestVersion

          public java.lang.String getLatestVersion()

      Description copied from interface: `OMEXMLService`
      Retrieves the latest supported version of the OME-XML schema.
      Specified by:
        `getLatestVersion` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.getLatestVersion()`

    - #### transformToLatestVersion

          public java.lang.String transformToLatestVersion(java.lang.String xml)
                                                    throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Transforms the given OME-XML string to the latest supported version of of the OME-XML schema.
      Specified by:
        `transformToLatestVersion` in interface `OMEXMLService`
      Throws:
        `loci.common.services.ServiceException`
      See Also:
        `OMEXMLService.transformToLatestVersion(String)`

    - #### createOMEXMLMetadata

          public OMEXMLMetadata createOMEXMLMetadata()
                                              throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package.
      Specified by:
        `createOMEXMLMetadata` in interface `OMEXMLService`
      Returns:
        A new instance of `AbstractOMEXMLMetadata`, or null if the class is not available.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.createOMEXMLMetadata()`

    - #### createOMEXMLMetadata

          public OMEXMLMetadata createOMEXMLMetadata(java.lang.String xml)
                                              throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package, wrapping a DOM representation of the given OME-XML string.
      Specified by:
        `createOMEXMLMetadata` in interface `OMEXMLService`
      Returns:
        A new instance of `AbstractOMEXMLMetadata`, or null if the class is not available.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.createOMEXMLMetadata(java.lang.String)`

    - #### createOMEXMLMetadata

          public OMEXMLMetadata createOMEXMLMetadata(java.lang.String xml,
                                                     java.lang.String version)
                                              throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package, wrapping a DOM representation of the given OME-XML string.
      Specified by:
        `createOMEXMLMetadata` in interface `OMEXMLService`
      Parameters:
        `xml` - The OME-XML string to use for initial population of the metadata object.
        `version` - The OME-XML version to use (e.g., "2003-FC" or "2007-06"). If the xml and version parameters are both null, the newest version is used.
      Returns:
        A new instance of `AbstractOMEXMLMetadata`, or null if the class is not available.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.createOMEXMLMetadata(java.lang.String, java.lang.String)`

    - #### createOMEXMLRoot

          public ome.xml.model.OMEModelObject createOMEXMLRoot(java.lang.String xml)
                                                        throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Constructs an OME root node.
      Specified by:
        `createOMEXMLRoot` in interface `OMEXMLService`
      Parameters:
        `xml` - String of XML to create the root node from.
      Returns:
        An ome.xml.model.OMEModelObject subclass root node.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.createOMEXMLRoot(java.lang.String)`

    - #### isOMEXMLMetadata

          public boolean isOMEXMLMetadata(java.lang.Object o)

      Description copied from interface: `OMEXMLService`
      Checks whether the given object is an OME-XML metadata object.
      Specified by:
        `isOMEXMLMetadata` in interface `OMEXMLService`
      Returns:
        True if the object is an instance of `OMEXMLMetadata`.
      See Also:
        `OMEXMLService.isOMEXMLMetadata(java.lang.Object)`

    - #### isOMEXMLRoot

          public boolean isOMEXMLRoot(java.lang.Object o)

      Description copied from interface: `OMEXMLService`
      Checks whether the given object is an OME-XML root object.
      Specified by:
        `isOMEXMLRoot` in interface `OMEXMLService`
      Returns:
        True if the object is an instance of `OME`.
      See Also:
        `OMEXMLService.isOMEXMLRoot(java.lang.Object)`

    - #### createRoot

          private ome.xml.meta.OMEXMLMetadataRoot createRoot(java.lang.String xml)
                                                      throws loci.common.services.ServiceException

      Constructs an OME root node. NOTE: This method is mostly here to ensure type safety of return values as instances of service dependency classes should not leak out of the interface.
      Parameters:
        `xml` - String of XML to create the root node from.
      Returns:
        An ome.xml.model.OMEModelObject subclass root node.
      Throws:
        `java.io.IOException` - If there is an error reading from the string.
        `org.xml.sax.SAXException` - If there is an error parsing the XML.
        `javax.xml.parsers.ParserConfigurationException` - If there is an error preparing the parsing infrastructure.
        `loci.common.services.ServiceException`

    - #### getOMEXMLVersion

          public java.lang.String getOMEXMLVersion(java.lang.Object o)

      Description copied from interface: `OMEXMLService`
      Gets the schema version for the given OME-XML metadata or root object (e.g., "2007-06" or "2003-FC").
      Specified by:
        `getOMEXMLVersion` in interface `OMEXMLService`
      Returns:
        OME-XML schema version, or null if the object is not an instance of `OMEXMLMetadata`.
      See Also:
        `OMEXMLService.getOMEXMLVersion(java.lang.Object)`

    - #### getOMEMetadata

          public OMEXMLMetadata getOMEMetadata(MetadataRetrieve src)
                                        throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Returns a `OMEXMLMetadata` object with the same contents as the given MetadataRetrieve, converting it if necessary.
      Specified by:
        `getOMEMetadata` in interface `OMEXMLService`
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.getOMEMetadata(loci.formats.meta.MetadataRetrieve)`

    - #### getOMEXML

          public java.lang.String getOMEXML(MetadataRetrieve src)
                                     throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Extracts an OME-XML metadata string from the given metadata object, by converting to an OME-XML metadata object if necessary.
      Specified by:
        `getOMEXML` in interface `OMEXMLService`
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.getOMEXML(loci.formats.meta.MetadataRetrieve)`

    - #### validateOMEXML

          public boolean validateOMEXML(java.lang.String xml)

      Description copied from interface: `OMEXMLService`
      Attempts to validate the given OME-XML string using Java's XML validation facility. Requires Java 1.5+.
      Specified by:
        `validateOMEXML` in interface `OMEXMLService`
      Parameters:
        `xml` - XML string to validate.
      Returns:
        true if the XML successfully validates.
      See Also:
        `OMEXMLService.validateOMEXML(java.lang.String)`

    - #### validateOMEXML

          public boolean validateOMEXML(java.lang.String xml,
                                        boolean pixelsHack)

      Description copied from interface: `OMEXMLService`
      Attempts to validate the given OME-XML string using Java's XML validation facility. Requires Java 1.5+.
      Specified by:
        `validateOMEXML` in interface `OMEXMLService`
      Parameters:
        `xml` - XML string to validate.
        `pixelsHack` - Whether to ignore validation errors due to childless Pixels elements
      Returns:
        true if the XML successfully validates.
      See Also:
        `OMEXMLService.validateOMEXML(java.lang.String, boolean)`

    - #### getModuloAlongZ

          public Modulo getModuloAlongZ(OMEXMLMetadata omexml,
                                        int image)

      Description copied from interface: `OMEXMLService`
      Retrieve the ModuloAlongZ annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongZ annotation is present, return null.
      Specified by:
        `getModuloAlongZ` in interface `OMEXMLService`
      Parameters:
        `omexml` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked
      See Also:
        `OMEXMLService.getModuloAlongZ(OMEXMLMetadata, int)`

    - #### getModuloAlongC

          public Modulo getModuloAlongC(OMEXMLMetadata omexml,
                                        int image)

      Description copied from interface: `OMEXMLService`
      Retrieve the ModuloAlongC annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongC annotation is present, return null.
      Specified by:
        `getModuloAlongC` in interface `OMEXMLService`
      Parameters:
        `omexml` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked
      See Also:
        `OMEXMLService.getModuloAlongC(OMEXMLMetadata, int)`

    - #### getModuloAlongT

          public Modulo getModuloAlongT(OMEXMLMetadata omexml,
                                        int image)

      Description copied from interface: `OMEXMLService`
      Retrieve the ModuloAlongT annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongT annotation is present, return null.
      Specified by:
        `getModuloAlongT` in interface `OMEXMLService`
      Parameters:
        `omexml` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked
      See Also:
        `OMEXMLService.getModuloAlongT(OMEXMLMetadata, int)`

    - #### getModuloAlong

          private Modulo getModuloAlong(OMEXMLMetadata omexml,
                                        java.lang.String tag,
                                        int image)

      Create a `Modulo` corresponding to the given ModuloAlong* tag.
      Parameters:
        `omexml` - the OMEXMLMetadata from which to retrieve the ModuloAlong* tag
        `tag` - the tag name (e.g. "ModuloAlongC")
        `image` - the Image index within the OMEXMLMetadata
      Returns:
        the corresponding Modulo object

    - #### getOriginalMetadata

          public java.util.Hashtable getOriginalMetadata(OMEXMLMetadata omexmlMeta)

      Description copied from interface: `OMEXMLService`
      Parse any OriginalMetadata annotations from the given OME-XML metadata object and store them in a Hashtable.
      Specified by:
        `getOriginalMetadata` in interface `OMEXMLService`
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.
      See Also:
        `OMEXMLService.getOriginalMetadata(loci.formats.ome.OMEXMLMetadata)`

    - #### populateOriginalMetadata

          public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta,
                                               java.util.Hashtable<java.lang.String,java.lang.Object> metadata)

      Description copied from interface: `OMEXMLService`
      Adds the key/value pairs in the specified Hashtable as new OriginalMetadata annotations in the given OME-XML metadata object.
      Specified by:
        `populateOriginalMetadata` in interface `OMEXMLService`
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.
        `metadata` - A hashtable containing metadata key/value pairs.
      See Also:
        `OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, Hashtable)`

    - #### populateOriginalMetadata

          public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta,
                                               java.lang.String key,
                                               java.lang.String value)

      Description copied from interface: `OMEXMLService`
      Adds the specified key/value pair as a new OriginalMetadata node to the given OME-XML metadata object.
      Specified by:
        `populateOriginalMetadata` in interface `OMEXMLService`
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.
        `key` - Metadata key to populate.
        `value` - Metadata value corresponding to the specified key.
      See Also:
        `OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, java.lang.String, java.lang.String)`

    - #### convertMetadata

          public void convertMetadata(java.lang.String xml,
                                      MetadataStore dest)
                               throws loci.common.services.ServiceException

      Description copied from interface: `OMEXMLService`
      Converts information from an OME-XML string (source) into a metadata store (destination).
      Specified by:
        `convertMetadata` in interface `OMEXMLService`
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.
      See Also:
        `OMEXMLService.convertMetadata(java.lang.String, loci.formats.meta.MetadataStore)`

    - #### convertMetadata

          public void convertMetadata(MetadataRetrieve src,
                                      MetadataStore dest)

      Description copied from interface: `OMEXMLService`
      Copies information from a metadata retrieval object (source) into a metadata store (destination).
      Specified by:
        `convertMetadata` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.convertMetadata(loci.formats.meta.MetadataRetrieve, loci.formats.meta.MetadataStore)`

    - #### removeBinData

          public void removeBinData(OMEXMLMetadata omexmlMeta)

      Description copied from interface: `OMEXMLService`
      Remove all of the BinData elements from the given OME-XML metadata object.
      Specified by:
        `removeBinData` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.removeBinData(OMEXMLMetadata)`

    - #### removeTiffData

          public void removeTiffData(OMEXMLMetadata omexmlMeta)

      Description copied from interface: `OMEXMLService`
      Remove all of the TiffData elements from the given OME-XML metadata object.
      Specified by:
        `removeTiffData` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.removeTiffData(OMEXMLMetadata)`

    - #### removeChannels

          public void removeChannels(OMEXMLMetadata omexmlMeta,
                                     int image,
                                     int sizeC)

      Description copied from interface: `OMEXMLService`
      Remove all but the first sizeC valid Channel elements from the given OME-XML metadata object.
      Specified by:
        `removeChannels` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.removeChannels(OMEXMLMetadata, int, int)`

    - #### addMetadataOnly

          public void addMetadataOnly(OMEXMLMetadata omexmlMeta,
                                      int image)

      Description copied from interface: `OMEXMLService`
      Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.
      Specified by:
        `addMetadataOnly` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.addMetadataOnly(OMEXMLMetadata, int)`

    - #### addMetadataOnly

          public void addMetadataOnly(OMEXMLMetadata omexmlMeta,
                                      int image,
                                      boolean resolve)

      Description copied from interface: `OMEXMLService`
      Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object. If the 'resolve' flag is set, references in the OME-XML metadata object will be resolved before the new element is inserted.
      Specified by:
        `addMetadataOnly` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.addMetadataOnly(OMEXMLMetadata, int, boolean)`

    - #### isEqual

          public boolean isEqual(OMEXMLMetadata src1,
                                 OMEXMLMetadata src2)

      Description copied from interface: `OMEXMLService`
      Determine whether or not two OMEXMLMetadata objects are equal. Equality is defined as: * having the same object graph (without regard to specific ID values) * having the exact same attribute values on every node (with the exception of 'ID' attributes) Note that StructuredAnnotations are ignored, i.e. the two OMEXMLMetadata objects may have wildly different things under StructuredAnnotations and still be considered equal.
      Specified by:
        `isEqual` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.isEqual(OMEXMLMetadata, OMEXMLMetadata)`

    - #### addModuloAlong

          public void addModuloAlong(OMEXMLMetadata meta,
                                     CoreMetadata core,
                                     int imageIdx)

      Description copied from interface: `OMEXMLService`
      Adds ModuloAlong* annotations to the given OME-XML metadata object, using the given CoreMetadata object to determine modulo dimensions.
      Specified by:
        `addModuloAlong` in interface `OMEXMLService`
      Parameters:
        `meta` - An object of type `OMEXMLMetadata`
        `core` - A fully populated object of type `CoreMetadata`
        `imageIdx` - Index of the Image to which the annotation should be linked.

    - #### createModulo

          private void createModulo(OMEXMLMetadata meta,
                                    Modulo modulo,
                                    ome.xml.model.StructuredAnnotations annotations,
                                    ome.xml.model.Image image,
                                    int imageIdx,
                                    int annotationIndex,
                                    int imageAnnotation)

      Create a ModuloAlong* annotation corresponding to the given `Modulo`.
      Parameters:
        `meta` - the OMEXMLMetadata in which to create the annotation
        `modulo` - the Modulo object that contains the annotation data
        `annotations` - the list of existing annotations
        `image` - the Image to which the new annotation should be linked
        `imageIdx` - the index of the Image
        `annotationIndex` - the index to be assigned to the new annotation
        `imageAnnotation` - the index to be assigned to the new annotation link

    - #### asStore

          public MetadataStore asStore(MetadataRetrieve meta)

      Description copied from interface: `OMEXMLService`
      Gets the given `MetadataRetrieve` object as a `MetadataStore`. Returns null if the object is incompatible and cannot be casted.
      Specified by:
        `asStore` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.asStore(loci.formats.meta.MetadataRetrieve)`

    - #### asRetrieve

          public MetadataRetrieve asRetrieve(MetadataStore meta)

      Description copied from interface: `OMEXMLService`
      Gets the given `MetadataStore` object as a `MetadataRetrieve`. Returns null if the object is incompatible and cannot be casted.
      Specified by:
        `asRetrieve` in interface `OMEXMLService`
      See Also:
        `OMEXMLService.asRetrieve(loci.formats.meta.MetadataStore)`

    - #### verifyOMENamespace

          private java.lang.String verifyOMENamespace(java.lang.String xml)

      Ensures that an xmlns:ome element exists.

    - #### equals

          public boolean equals(org.w3c.dom.Node e1,
                                org.w3c.dom.Node e2)

      Compares two Elements for equality.

    - #### findRootNode

          private org.w3c.dom.Node findRootNode(org.w3c.dom.Node child)

      Return the absolute root node for the specified child node.

    - #### findChildWithID

          private org.w3c.dom.Node findChildWithID(org.w3c.dom.Node root,
                                                   java.lang.String name,
                                                   java.lang.String id)

      Return the child node with specified value for the "ID" attribute.

Copyright © 2026 Open Microscopy Environment