loci.formats.services

## Interface OMEXMLService

- All Superinterfaces:
    loci.common.services.Service
  All Known Implementing Classes:
    OMEXMLServiceImpl

      public interface OMEXMLService
      extends loci.common.services.Service

- - ### Method Summary

    All Methods Instance Methods Abstract 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 omexmlMeta, CoreMetadata core, int image)` 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).
    `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.
    `java.lang.String` | `getLatestVersion()` Retrieves the latest supported version of the OME-XML schema.
    `Modulo` | `getModuloAlongC(OMEXMLMetadata omexmlMeta, int image)` Retrieve the ModuloAlongC annotation in the given Image in the given OME-XML metadata object.
    `Modulo` | `getModuloAlongT(OMEXMLMetadata omexmlMeta, int image)` Retrieve the ModuloAlongT annotation in the given Image in the given OME-XML metadata object.
    `Modulo` | `getModuloAlongZ(OMEXMLMetadata omexmlMeta, 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.

- - ### Method Detail

    - #### getLatestVersion

          java.lang.String getLatestVersion()

      Retrieves the latest supported version of the OME-XML schema.

    - #### transformToLatestVersion

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

      Transforms the given OME-XML string to the latest supported version of of the OME-XML schema.
      Throws:
        `loci.common.services.ServiceException`

    - #### createOMEXMLMetadata

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

      Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optional `loci.formats.ome` package.
      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.

    - #### createOMEXMLMetadata

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

      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.
      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.

    - #### createOMEXMLMetadata

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

      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.
      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.

    - #### createOMEXMLRoot

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

      Constructs an OME root node.
      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.

    - #### isOMEXMLMetadata

          boolean isOMEXMLMetadata(java.lang.Object o)

      Checks whether the given object is an OME-XML metadata object.
      Returns:
        True if the object is an instance of `OMEXMLMetadata`.

    - #### isOMEXMLRoot

          boolean isOMEXMLRoot(java.lang.Object o)

      Checks whether the given object is an OME-XML root object.
      Returns:
        True if the object is an instance of `OME`.

    - #### getOMEXMLVersion

          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").
      Returns:
        OME-XML schema version, or null if the object is not an instance of `OMEXMLMetadata`.

    - #### getOMEMetadata

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

      Returns a `OMEXMLMetadata` object with the same contents as the given MetadataRetrieve, converting it if necessary.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.

    - #### getOMEXML

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

      Extracts an OME-XML metadata string from the given metadata object, by converting to an OME-XML metadata object if necessary.
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.

    - #### validateOMEXML

          boolean validateOMEXML(java.lang.String xml)

      Attempts to validate the given OME-XML string using Java's XML validation facility. Requires Java 1.5+.
      Parameters:
        `xml` - XML string to validate.
      Returns:
        true if the XML successfully validates.

    - #### validateOMEXML

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

      Attempts to validate the given OME-XML string using Java's XML validation facility. Requires Java 1.5+.
      Parameters:
        `xml` - XML string to validate.
        `pixelsHack` - Whether to ignore validation errors due to childless Pixels elements
      Returns:
        true if the XML successfully validates.

    - #### populateOriginalMetadata

          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.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.
        `metadata` - A hashtable containing metadata key/value pairs.

    - #### getModuloAlongZ

          Modulo getModuloAlongZ(OMEXMLMetadata omexmlMeta,
                                 int image)

      Retrieve the ModuloAlongZ annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongZ annotation is present, return null.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked

    - #### getModuloAlongC

          Modulo getModuloAlongC(OMEXMLMetadata omexmlMeta,
                                 int image)

      Retrieve the ModuloAlongC annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongC annotation is present, return null.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked

    - #### getModuloAlongT

          Modulo getModuloAlongT(OMEXMLMetadata omexmlMeta,
                                 int image)

      Retrieve the ModuloAlongT annotation in the given Image in the given OME-XML metadata object. If no ModuloAlongT annotation is present, return null.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`
        `image` - the index of the Image to which the Annotation is linked

    - #### getOriginalMetadata

          java.util.Hashtable getOriginalMetadata(OMEXMLMetadata omexmlMeta)

      Parse any OriginalMetadata annotations from the given OME-XML metadata object and store them in a Hashtable.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.

    - #### populateOriginalMetadata

          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.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`.
        `key` - Metadata key to populate.
        `value` - Metadata value corresponding to the specified key.

    - #### addModuloAlong

          void addModuloAlong(OMEXMLMetadata omexmlMeta,
                              CoreMetadata core,
                              int image)

      Adds ModuloAlong* annotations to the given OME-XML metadata object, using the given CoreMetadata object to determine modulo dimensions.
      Parameters:
        `omexmlMeta` - An object of type `OMEXMLMetadata`
        `core` - A fully populated object of type `CoreMetadata`
        `image` - Index of the Image to which the annotation should be linked.

    - #### convertMetadata

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

      Converts information from an OME-XML string (source) into a metadata store (destination).
      Throws:
        `loci.common.services.ServiceException` - If there is an error creating the OME-XML metadata object.

    - #### convertMetadata

          void convertMetadata(MetadataRetrieve src,
                               MetadataStore dest)

      Copies information from a metadata retrieval object (source) into a metadata store (destination).

    - #### removeBinData

          void removeBinData(OMEXMLMetadata omexmlMeta)

      Remove all of the BinData elements from the given OME-XML metadata object.

    - #### removeTiffData

          void removeTiffData(OMEXMLMetadata omexmlMeta)

      Remove all of the TiffData elements from the given OME-XML metadata object.

    - #### removeChannels

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

      Remove all but the first sizeC valid Channel elements from the given OME-XML metadata object.

    - #### addMetadataOnly

          void addMetadataOnly(OMEXMLMetadata omexmlMeta,
                               int image)

      Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.

    - #### addMetadataOnly

          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. If the 'resolve' flag is set, references in the OME-XML metadata object will be resolved before the new element is inserted.

    - #### isEqual

          boolean isEqual(OMEXMLMetadata src1,
                          OMEXMLMetadata src2)

      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.

    - #### asStore

          MetadataStore asStore(MetadataRetrieve meta)

      Gets the given `MetadataRetrieve` object as a `MetadataStore`. Returns null if the object is incompatible and cannot be casted.

    - #### asRetrieve

          MetadataRetrieve asRetrieve(MetadataStore meta)

      Gets the given `MetadataStore` object as a `MetadataRetrieve`. Returns null if the object is incompatible and cannot be casted.

Copyright © 2026 Open Microscopy Environment