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.
|
checkClassDependency
public static final java.lang.String LATEST_VERSION
public static final java.lang.String NO_OME_XML_MSG
public java.lang.String getLatestVersion()
OMEXMLService
getLatestVersion
in interface OMEXMLService
OMEXMLService.getLatestVersion()
public java.lang.String transformToLatestVersion(java.lang.String xml) throws ServiceException
OMEXMLService
transformToLatestVersion
in interface OMEXMLService
ServiceException
OMEXMLService.transformToLatestVersion(String)
public OMEXMLMetadata createOMEXMLMetadata() throws ServiceException
OMEXMLService
loci.formats.ome
package.createOMEXMLMetadata
in interface OMEXMLService
AbstractOMEXMLMetadata
,
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
OMEXMLService
loci.formats.ome
package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata
in interface OMEXMLService
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)
public OMEXMLMetadata createOMEXMLMetadata(java.lang.String xml, java.lang.String version) throws ServiceException
OMEXMLService
loci.formats.ome
package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata
in interface OMEXMLService
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.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
OMEXMLService
createOMEXMLRoot
in interface OMEXMLService
xml
- 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)
OMEXMLService
isOMEXMLMetadata
in interface OMEXMLService
OMEXMLMetadata
.OMEXMLService.isOMEXMLMetadata(java.lang.Object)
public boolean isOMEXMLRoot(java.lang.Object o)
OMEXMLService
isOMEXMLRoot
in interface OMEXMLService
OME
.OMEXMLService.isOMEXMLRoot(java.lang.Object)
public java.lang.String getOMEXMLVersion(java.lang.Object o)
OMEXMLService
getOMEXMLVersion
in interface OMEXMLService
OMEXMLMetadata
.OMEXMLService.getOMEXMLVersion(java.lang.Object)
public OMEXMLMetadata getOMEMetadata(MetadataRetrieve src) throws ServiceException
OMEXMLService
OMEXMLMetadata
object with the same
contents as the given MetadataRetrieve, converting it if necessary.getOMEMetadata
in interface OMEXMLService
ServiceException
- 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
OMEXMLService
getOMEXML
in interface OMEXMLService
ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.getOMEXML(loci.formats.meta.MetadataRetrieve)
public boolean validateOMEXML(java.lang.String xml)
OMEXMLService
validateOMEXML
in interface OMEXMLService
xml
- XML string to validate.OMEXMLService.validateOMEXML(java.lang.String)
public boolean validateOMEXML(java.lang.String xml, boolean pixelsHack)
OMEXMLService
validateOMEXML
in interface OMEXMLService
xml
- 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)
OMEXMLService
getModuloAlongZ
in interface OMEXMLService
omexml
- An object of type
OMEXMLMetadata
image
- the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongZ(OMEXMLMetadata, int)
public Modulo getModuloAlongC(OMEXMLMetadata omexml, int image)
OMEXMLService
getModuloAlongC
in interface OMEXMLService
omexml
- An object of type
OMEXMLMetadata
image
- the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongC(OMEXMLMetadata, int)
public Modulo getModuloAlongT(OMEXMLMetadata omexml, int image)
OMEXMLService
getModuloAlongT
in interface OMEXMLService
omexml
- An object of type
OMEXMLMetadata
image
- the index of the Image to which the Annotation is linkedOMEXMLService.getModuloAlongT(OMEXMLMetadata, int)
public java.util.Hashtable getOriginalMetadata(OMEXMLMetadata omexmlMeta)
OMEXMLService
getOriginalMetadata
in interface OMEXMLService
omexmlMeta
- 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)
OMEXMLService
populateOriginalMetadata
in interface OMEXMLService
omexmlMeta
- 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)
OMEXMLService
populateOriginalMetadata
in interface OMEXMLService
omexmlMeta
- 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
OMEXMLService
convertMetadata
in interface OMEXMLService
ServiceException
- 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)
OMEXMLService
convertMetadata
in interface OMEXMLService
OMEXMLService.convertMetadata(loci.formats.meta.MetadataRetrieve, loci.formats.meta.MetadataStore)
public void removeBinData(OMEXMLMetadata omexmlMeta)
OMEXMLService
removeBinData
in interface OMEXMLService
OMEXMLService.removeBinData(OMEXMLMetadata)
public void removeChannels(OMEXMLMetadata omexmlMeta, int image, int sizeC)
OMEXMLService
removeChannels
in interface OMEXMLService
OMEXMLService.removeChannels(OMEXMLMetadata, int, int)
public void addMetadataOnly(OMEXMLMetadata omexmlMeta, int image)
OMEXMLService
addMetadataOnly
in interface OMEXMLService
OMEXMLService.addMetadataOnly(OMEXMLMetadata, int)
public boolean isEqual(OMEXMLMetadata src1, OMEXMLMetadata src2)
OMEXMLService
isEqual
in interface OMEXMLService
OMEXMLService.isEqual(OMEXMLMetadata, OMEXMLMetadata)
public void addModuloAlong(OMEXMLMetadata meta, CoreMetadata core, int imageIdx)
OMEXMLService
addModuloAlong
in interface OMEXMLService
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.public MetadataStore asStore(MetadataRetrieve meta)
OMEXMLService
MetadataRetrieve
object as a MetadataStore
.
Returns null if the object is incompatible and cannot be casted.asStore
in interface OMEXMLService
OMEXMLService.asStore(loci.formats.meta.MetadataRetrieve)
public MetadataRetrieve asRetrieve(MetadataStore meta)
OMEXMLService
MetadataStore
object as a MetadataRetrieve
.
Returns null if the object is incompatible and cannot be casted.asRetrieve
in interface OMEXMLService
OMEXMLService.asRetrieve(loci.formats.meta.MetadataStore)
public boolean equals(org.w3c.dom.Node e1, org.w3c.dom.Node e2)
Copyright © 2014 Open Microscopy Environment