public class OMEXMLServiceImpl extends AbstractService implements OMEXMLService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LATEST_VERSION
Latest OME-XML version namespace.
|
static java.lang.String |
NO_OME_XML_MSG |
| Constructor and Description |
|---|
OMEXMLServiceImpl()
Default constructor.
|
| 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 |
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).
|
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. |
OMEModelObject |
createOMEXMLRoot(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.
|
java.lang.String |
getLatestVersion()
Retrieves the latest supported version of the OME-XML schema.
|
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.
|
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.
|
checkClassDependencypublic static final java.lang.String LATEST_VERSION
public static final java.lang.String NO_OME_XML_MSG
public java.lang.String getLatestVersion()
OMEXMLServicegetLatestVersion in interface OMEXMLServiceOMEXMLService.getLatestVersion()public java.lang.String transformToLatestVersion(java.lang.String xml)
throws ServiceException
OMEXMLServicetransformToLatestVersion in interface OMEXMLServiceServiceExceptionOMEXMLService.transformToLatestVersion(String)public OMEXMLMetadata createOMEXMLMetadata() throws ServiceException
OMEXMLServiceloci.formats.ome package.createOMEXMLMetadata in interface OMEXMLServiceAbstractOMEXMLMetadata,
or null if the class is not available.ServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata()public OMEXMLMetadata createOMEXMLMetadata(java.lang.String xml) throws ServiceException
OMEXMLServiceloci.formats.ome package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata in interface OMEXMLServiceAbstractOMEXMLMetadata,
or null if the class is not available.ServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata(java.lang.String)public OMEXMLMetadata createOMEXMLMetadata(java.lang.String xml, java.lang.String version) throws ServiceException
OMEXMLServiceloci.formats.ome package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata in interface OMEXMLServicexml - 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.AbstractOMEXMLMetadata,
or null if the class is not available.ServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata(java.lang.String, java.lang.String)public OMEModelObject createOMEXMLRoot(java.lang.String xml) throws ServiceException
OMEXMLServicecreateOMEXMLRoot in interface OMEXMLServicexml - String of XML to create the root node from.ServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLRoot(java.lang.String)public boolean isOMEXMLMetadata(java.lang.Object o)
OMEXMLServiceisOMEXMLMetadata in interface OMEXMLServiceOMEXMLMetadata.OMEXMLService.isOMEXMLMetadata(java.lang.Object)public boolean isOMEXMLRoot(java.lang.Object o)
OMEXMLServiceisOMEXMLRoot in interface OMEXMLServiceOME.OMEXMLService.isOMEXMLRoot(java.lang.Object)public java.lang.String getOMEXMLVersion(java.lang.Object o)
OMEXMLServicegetOMEXMLVersion in interface OMEXMLServiceOMEXMLMetadata.OMEXMLService.getOMEXMLVersion(java.lang.Object)public OMEXMLMetadata getOMEMetadata(MetadataRetrieve src) throws ServiceException
OMEXMLServiceOMEXMLMetadata object with the same
contents as the given MetadataRetrieve, converting it if necessary.getOMEMetadata in interface OMEXMLServiceServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.getOMEMetadata(loci.formats.meta.MetadataRetrieve)public java.lang.String getOMEXML(MetadataRetrieve src) throws ServiceException
OMEXMLServicegetOMEXML in interface OMEXMLServiceServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.getOMEXML(loci.formats.meta.MetadataRetrieve)public boolean validateOMEXML(java.lang.String xml)
OMEXMLServicevalidateOMEXML in interface OMEXMLServicexml - XML string to validate.OMEXMLService.validateOMEXML(java.lang.String)public boolean validateOMEXML(java.lang.String xml,
boolean pixelsHack)
OMEXMLServicevalidateOMEXML in interface OMEXMLServicexml - XML string to validate.pixelsHack - Whether to ignore validation errors
due to childless Pixels elementsOMEXMLService.validateOMEXML(java.lang.String, boolean)public Modulo getModuloAlongZ(OMEXMLMetadata omexml, int image)
OMEXMLServicegetModuloAlongZ in interface OMEXMLServiceomexml - An object of type
OMEXMLMetadataimage - the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongZ(OMEXMLMetadata, int)public Modulo getModuloAlongC(OMEXMLMetadata omexml, int image)
OMEXMLServicegetModuloAlongC in interface OMEXMLServiceomexml - An object of type
OMEXMLMetadataimage - the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongC(OMEXMLMetadata, int)public Modulo getModuloAlongT(OMEXMLMetadata omexml, int image)
OMEXMLServicegetModuloAlongT in interface OMEXMLServiceomexml - An object of type
OMEXMLMetadataimage - the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongT(OMEXMLMetadata, int)public java.util.Hashtable getOriginalMetadata(OMEXMLMetadata omexmlMeta)
OMEXMLServicegetOriginalMetadata in interface OMEXMLServiceomexmlMeta - An object of type
OMEXMLMetadata.OMEXMLService.getOriginalMetadata(loci.formats.ome.OMEXMLMetadata)public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta, java.util.Hashtable<java.lang.String,java.lang.Object> metadata)
OMEXMLServicepopulateOriginalMetadata in interface OMEXMLServiceomexmlMeta - An object of type
OMEXMLMetadata.metadata - A hashtable containing metadata key/value pairs.OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, Hashtable)public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta, java.lang.String key, java.lang.String value)
OMEXMLServicepopulateOriginalMetadata in interface OMEXMLServiceomexmlMeta - An object of type
OMEXMLMetadata.key - Metadata key to populate.value - Metadata value corresponding to the specified key.OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, java.lang.String, java.lang.String)public void convertMetadata(java.lang.String xml,
MetadataStore dest)
throws ServiceException
OMEXMLServiceconvertMetadata in interface OMEXMLServiceServiceException - If there is an error creating the OME-XML
metadata object.OMEXMLService.convertMetadata(java.lang.String, loci.formats.meta.MetadataStore)public void convertMetadata(MetadataRetrieve src, MetadataStore dest)
OMEXMLServiceconvertMetadata in interface OMEXMLServiceOMEXMLService.convertMetadata(loci.formats.meta.MetadataRetrieve, loci.formats.meta.MetadataStore)public void removeBinData(OMEXMLMetadata omexmlMeta)
OMEXMLServiceremoveBinData in interface OMEXMLServiceOMEXMLService.removeBinData(OMEXMLMetadata)public void removeChannels(OMEXMLMetadata omexmlMeta, int image, int sizeC)
OMEXMLServiceremoveChannels in interface OMEXMLServiceOMEXMLService.removeChannels(OMEXMLMetadata, int, int)public void addMetadataOnly(OMEXMLMetadata omexmlMeta, int image)
OMEXMLServiceaddMetadataOnly in interface OMEXMLServiceOMEXMLService.addMetadataOnly(OMEXMLMetadata, int)public boolean isEqual(OMEXMLMetadata src1, OMEXMLMetadata src2)
OMEXMLServiceisEqual in interface OMEXMLServiceOMEXMLService.isEqual(OMEXMLMetadata, OMEXMLMetadata)public void addModuloAlong(OMEXMLMetadata meta, CoreMetadata core, int imageIdx)
OMEXMLServiceaddModuloAlong in interface OMEXMLServicemeta - An object of type OMEXMLMetadatacore - A fully populated object of type
CoreMetadataimageIdx - Index of the Image to which the annotation should be linked.public MetadataStore asStore(MetadataRetrieve meta)
OMEXMLServiceMetadataRetrieve object as a MetadataStore.
Returns null if the object is incompatible and cannot be casted.asStore in interface OMEXMLServiceOMEXMLService.asStore(loci.formats.meta.MetadataRetrieve)public MetadataRetrieve asRetrieve(MetadataStore meta)
OMEXMLServiceMetadataStore object as a MetadataRetrieve.
Returns null if the object is incompatible and cannot be casted.asRetrieve in interface OMEXMLServiceOMEXMLService.asRetrieve(loci.formats.meta.MetadataStore)public boolean equals(org.w3c.dom.Node e1,
org.w3c.dom.Node e2)
Copyright © 2014 Open Microscopy Environment