Package 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
Modifier and TypeMethodDescriptionvoidaddMetadataOnly(OMEXMLMetadata omexmlMeta, int image) Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.voidaddMetadataOnly(OMEXMLMetadata omexmlMeta, int image, boolean resolve) Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object.voidaddModuloAlong(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.asRetrieve(MetadataStore meta) Gets the givenMetadataStoreobject as aMetadataRetrieve.asStore(MetadataRetrieve meta) Gets the givenMetadataRetrieveobject as aMetadataStore.voidconvertMetadata(String xml, MetadataStore dest) Converts information from an OME-XML string (source) into a metadata store (destination).voidconvertMetadata(MetadataRetrieve src, MetadataStore dest) Copies information from a metadata retrieval object (source) into a metadata store (destination).Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optionalloci.formats.omepackage.Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optionalloci.formats.omepackage, wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata(String xml, String version) Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optionalloci.formats.omepackage, wrapping a DOM representation of the given OME-XML string.ome.xml.model.OMEModelObjectcreateOMEXMLRoot(String xml) Constructs an OME root node.Retrieves the latest supported version of the OME-XML schema.getModuloAlongC(OMEXMLMetadata omexmlMeta, int image) Retrieve the ModuloAlongC annotation in the given Image in the given OME-XML metadata object.getModuloAlongT(OMEXMLMetadata omexmlMeta, int image) Retrieve the ModuloAlongT annotation in the given Image in the given OME-XML metadata object.getModuloAlongZ(OMEXMLMetadata omexmlMeta, int image) Retrieve the ModuloAlongZ annotation in the given Image in the given OME-XML metadata object.Returns aOMEXMLMetadataobject with the same contents as the given MetadataRetrieve, converting it if necessary.Extracts an OME-XML metadata string from the given metadata object, by converting to an OME-XML metadata object if necessary.Gets the schema version for the given OME-XML metadata or root object (e.g., "2007-06" or "2003-FC").getOriginalMetadata(OMEXMLMetadata omexmlMeta) Parse any OriginalMetadata annotations from the given OME-XML metadata object and store them in a Hashtable.booleanisEqual(OMEXMLMetadata src1, OMEXMLMetadata src2) Determine whether or not two OMEXMLMetadata objects are equal.booleanChecks whether the given object is an OME-XML metadata object.booleanChecks whether the given object is an OME-XML root object.voidpopulateOriginalMetadata(OMEXMLMetadata omexmlMeta, String key, String value) Adds the specified key/value pair as a new OriginalMetadata node to the given OME-XML metadata object.voidpopulateOriginalMetadata(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.voidremoveBinData(OMEXMLMetadata omexmlMeta) Remove all of the BinData elements from the given OME-XML metadata object.voidremoveChannels(OMEXMLMetadata omexmlMeta, int image, int sizeC) Remove all but the first sizeC valid Channel elements from the given OME-XML metadata object.voidremoveTiffData(OMEXMLMetadata omexmlMeta) Remove all of the TiffData elements from the given OME-XML metadata object.Transforms the given OME-XML string to the latest supported version of of the OME-XML schema.booleanvalidateOMEXML(String xml) Attempts to validate the given OME-XML string using Java's XML validation facility.booleanvalidateOMEXML(String xml, boolean pixelsHack) Attempts to validate the given OME-XML string using Java's XML validation facility.
-
Method Details
-
getLatestVersion
String getLatestVersion()Retrieves the latest supported version of the OME-XML schema. -
transformToLatestVersion
Transforms the given OME-XML string to the latest supported version of of the OME-XML schema.- Throws:
loci.common.services.ServiceException
-
createOMEXMLMetadata
Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optionalloci.formats.omepackage.- 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
Creates an OME-XML metadata object using reflection, to avoid direct dependencies on the optionalloci.formats.omepackage, 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 optionalloci.formats.omepackage, 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
Checks whether the given object is an OME-XML metadata object.- Returns:
- True if the object is an instance of
OMEXMLMetadata.
-
isOMEXMLRoot
Checks whether the given object is an OME-XML root object.- Returns:
- True if the object is an instance of
OME.
-
getOMEXMLVersion
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
Returns aOMEXMLMetadataobject 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
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
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
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
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 typeOMEXMLMetadata.metadata- A hashtable containing metadata key/value pairs.
-
getModuloAlongZ
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 typeOMEXMLMetadataimage- the index of the Image to which the Annotation is linked
-
getModuloAlongC
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 typeOMEXMLMetadataimage- the index of the Image to which the Annotation is linked
-
getModuloAlongT
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 typeOMEXMLMetadataimage- the index of the Image to which the Annotation is linked
-
getOriginalMetadata
Parse any OriginalMetadata annotations from the given OME-XML metadata object and store them in a Hashtable.- Parameters:
omexmlMeta- An object of typeOMEXMLMetadata.
-
populateOriginalMetadata
Adds the specified key/value pair as a new OriginalMetadata node to the given OME-XML metadata object.- Parameters:
omexmlMeta- An object of typeOMEXMLMetadata.key- Metadata key to populate.value- Metadata value corresponding to the specified key.
-
addModuloAlong
Adds ModuloAlong* annotations to the given OME-XML metadata object, using the given CoreMetadata object to determine modulo dimensions.- Parameters:
omexmlMeta- An object of typeOMEXMLMetadatacore- A fully populated object of typeCoreMetadataimage- Index of the Image to which the annotation should be linked.
-
convertMetadata
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
Copies information from a metadata retrieval object (source) into a metadata store (destination). -
removeBinData
Remove all of the BinData elements from the given OME-XML metadata object. -
removeTiffData
Remove all of the TiffData elements from the given OME-XML metadata object. -
removeChannels
Remove all but the first sizeC valid Channel elements from the given OME-XML metadata object. -
addMetadataOnly
Insert a MetadataOnly element under the Image specified by 'index' in the given OME-XML metadata object. -
addMetadataOnly
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
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 givenMetadataRetrieveobject as aMetadataStore. Returns null if the object is incompatible and cannot be casted. -
asRetrieve
Gets the givenMetadataStoreobject as aMetadataRetrieve. Returns null if the object is incompatible and cannot be casted.
-