Interface OMEXMLService

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

public interface OMEXMLService extends loci.common.services.Service
  • Method Details

    • getLatestVersion

      String getLatestVersion()
      Retrieves the latest supported version of the OME-XML schema.
    • transformToLatestVersion

      String transformToLatestVersion(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(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(String xml, 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(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(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(Object o)
      Checks whether the given object is an OME-XML root object.
      Returns:
      True if the object is an instance of OME.
    • getOMEXMLVersion

      String getOMEXMLVersion(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

      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(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(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, Hashtable<String,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

      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, String key, 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(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

      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.