public final class MetadataTools extends Object
MetadataStore
, MetadataRetrieve
,
and OME-XML strings.
Most of the methods require the optional loci.formats.ome
package, and optional ome-xml.jar library, to be present at runtime.
Modifier and Type | Method and Description |
---|---|
static MetadataRetrieve |
asRetrieve(MetadataStore meta)
Deprecated.
This method is not thread-safe; use
OMEXMLService.asRetrieve(MetadataStore)
instead. |
static String |
createLSID(String type,
int... indices)
Constructs an LSID, given the object type and indices.
|
static IMetadata |
createOMEXMLMetadata()
Creates an OME-XML metadata object using reflection, to avoid
direct dependencies on the optional
loci.formats.ome package. |
static IMetadata |
createOMEXMLMetadata(String xml)
Deprecated.
This method is not thread-safe; use
OMEXMLService.createOMEXMLMetadata(String)
instead. |
static IMetadata |
createOMEXMLMetadata(String xml,
String version)
Deprecated.
This method is not thread-safe; use
OMEXMLService.createOMEXMLMetadata(String,
String)
instead. |
static Object |
createOMEXMLRoot(String xml)
Deprecated.
This method is not thread-safe; use
OMEXMLService.createOMEXMLRoot(String)
instead. |
static String |
getLatestVersion()
Deprecated.
This method is not thread-safe; use
OMEXMLService.getLatestVersion()
instead. |
static IMetadata |
getOMEMetadata(MetadataRetrieve src)
Deprecated.
This method is not thread-safe; use
OMEXMLService.getOMEMetadata(MetadataRetrieve)
instead. |
static String |
getOMEXML(MetadataRetrieve src)
Deprecated.
This method is not thread-safe; use
OMEXMLService.getOMEXML(MetadataRetrieve)
instead. |
static String |
getOMEXMLVersion(Object o)
Deprecated.
This method is not thread-safe; use
OMEXMLService.getOMEXMLVersion(Object)
instead. |
static boolean |
isOMEXMLMetadata(Object o)
Deprecated.
This method is not thread-safe; use
OMEXMLService.isOMEXMLMetadata(Object)
instead. |
static boolean |
isOMEXMLRoot(Object o)
Deprecated.
This method is not thread-safe; use
OMEXMLService.isOMEXMLRoot(Object)
instead. |
static String[] |
keys(Hashtable<String,Object> meta)
Gets a sorted list of keys from the given hashtable.
|
static String |
makeSaneDimensionOrder(String dimensionOrder)
Adjusts the given dimension order as needed so that it contains exactly
one of each of the following characters: 'X', 'Y', 'Z', 'C', 'T'.
|
static void |
merge(Map<String,Object> src,
Map<String,Object> dest,
String prefix)
Merges the given lists of metadata, prepending the
specified prefix for the destination keys.
|
static void |
populateMetadata(MetadataStore store,
int series,
String imageName,
boolean littleEndian,
String dimensionOrder,
String pixelType,
int sizeX,
int sizeY,
int sizeZ,
int sizeC,
int sizeT,
int samplesPerPixel)
Populates the given
MetadataStore , for the specified series, using
the provided values. |
static void |
populateMetadata(MetadataStore store,
int series,
String imageName,
CoreMetadata coreMeta)
Populates the given
MetadataStore , for the specified series, using
the values from the provided CoreMetadata . |
static void |
populateMetadata(MetadataStore store,
String file,
int series,
String imageName,
boolean littleEndian,
String dimensionOrder,
String pixelType,
int sizeX,
int sizeY,
int sizeZ,
int sizeC,
int sizeT,
int samplesPerPixel)
Populates the given
MetadataStore , for the specified series, using
the provided values. |
static void |
populatePixels(MetadataStore store,
IFormatReader r)
Populates the 'pixels' element of the given metadata store, using core
metadata from the given reader.
|
static void |
populatePixels(MetadataStore store,
IFormatReader r,
boolean doPlane)
Populates the 'pixels' element of the given metadata store, using core
metadata from the given reader.
|
static void |
populatePixels(MetadataStore store,
IFormatReader r,
boolean doPlane,
boolean doImageName)
Populates the 'pixels' element of the given metadata store, using core
metadata from the given reader.
|
static void |
populatePixelsOnly(MetadataStore store,
IFormatReader r) |
static void |
populatePixelsOnly(MetadataStore store,
int series,
boolean littleEndian,
String dimensionOrder,
String pixelType,
int sizeX,
int sizeY,
int sizeZ,
int sizeC,
int sizeT,
int samplesPerPixel) |
static void |
setDefaultCreationDate(MetadataStore store,
String id,
int series)
Sets a default creation date.
|
static void |
setDefaultDateEnabled(boolean enabled)
Disables the setting of a default creation date.
|
static boolean |
validateOMEXML(String xml)
Deprecated.
This method is not thread-safe; use
OMEXMLService.validateOMEXML(String)
instead. |
static boolean |
validateOMEXML(String xml,
boolean pixelsHack)
Deprecated.
This method is not thread-safe; use
OMEXMLService.validateOMEXML(String, boolean)
instead. |
static void |
verifyMinimumPopulated(MetadataRetrieve src)
Checks whether the given metadata object has the minimum metadata
populated to successfully describe an Image.
|
static void |
verifyMinimumPopulated(MetadataRetrieve src,
int n)
Checks whether the given metadata object has the minimum metadata
populated to successfully describe the nth Image.
|
public static void populatePixels(MetadataStore store, IFormatReader r)
public static void populatePixels(MetadataStore store, IFormatReader r, boolean doPlane)
public static void populatePixels(MetadataStore store, IFormatReader r, boolean doPlane, boolean doImageName)
public static void populateMetadata(MetadataStore store, int series, String imageName, CoreMetadata coreMeta)
MetadataStore
, for the specified series, using
the values from the provided CoreMetadata
.
After calling this method, the metadata store will be sufficiently
populated for use with an IFormatWriter
(assuming it is also a
MetadataRetrieve
).
public static void populateMetadata(MetadataStore store, int series, String imageName, boolean littleEndian, String dimensionOrder, String pixelType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel)
MetadataStore
, for the specified series, using
the provided values.
After calling this method, the metadata store will be sufficiently
populated for use with an IFormatWriter
(assuming it is also a
MetadataRetrieve
).
public static void populateMetadata(MetadataStore store, String file, int series, String imageName, boolean littleEndian, String dimensionOrder, String pixelType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel)
MetadataStore
, for the specified series, using
the provided values.
After calling this method, the metadata store will be sufficiently
populated for use with an IFormatWriter
(assuming it is also a
MetadataRetrieve
).
public static void populatePixelsOnly(MetadataStore store, IFormatReader r)
public static void populatePixelsOnly(MetadataStore store, int series, boolean littleEndian, String dimensionOrder, String pixelType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel)
public static String createLSID(String type, int... indices)
public static void verifyMinimumPopulated(MetadataRetrieve src) throws FormatException
FormatException
- if there is a missing metadata field,
or the metadata object is uninitializedpublic static void verifyMinimumPopulated(MetadataRetrieve src, int n) throws FormatException
FormatException
- if there is a missing metadata field,
or the metadata object is uninitializedpublic static void setDefaultDateEnabled(boolean enabled)
enabled
- See above.setDefaultCreationDate(MetadataStore, String, int)
public static void setDefaultCreationDate(MetadataStore store, String id, int series)
setDefaultDateEnabled(boolean)
public static String makeSaneDimensionOrder(String dimensionOrder)
public static String[] keys(Hashtable<String,Object> meta)
public static void merge(Map<String,Object> src, Map<String,Object> dest, String prefix)
public static MetadataRetrieve asRetrieve(MetadataStore meta)
OMEXMLService.asRetrieve(MetadataStore)
instead.public static String getLatestVersion()
OMEXMLService.getLatestVersion()
instead.public static IMetadata createOMEXMLMetadata()
loci.formats.ome
package.AbstractOMEXMLMetadata
,
or null if one cannot be created.public static IMetadata createOMEXMLMetadata(String xml)
OMEXMLService.createOMEXMLMetadata(String)
instead.public static IMetadata createOMEXMLMetadata(String xml, String version)
OMEXMLService.createOMEXMLMetadata(String,
String)
instead.public static Object createOMEXMLRoot(String xml)
OMEXMLService.createOMEXMLRoot(String)
instead.public static boolean isOMEXMLMetadata(Object o)
OMEXMLService.isOMEXMLMetadata(Object)
instead.public static boolean isOMEXMLRoot(Object o)
OMEXMLService.isOMEXMLRoot(Object)
instead.public static String getOMEXMLVersion(Object o)
OMEXMLService.getOMEXMLVersion(Object)
instead.public static IMetadata getOMEMetadata(MetadataRetrieve src)
OMEXMLService.getOMEMetadata(MetadataRetrieve)
instead.public static String getOMEXML(MetadataRetrieve src)
OMEXMLService.getOMEXML(MetadataRetrieve)
instead.public static boolean validateOMEXML(String xml)
OMEXMLService.validateOMEXML(String)
instead.public static boolean validateOMEXML(String xml, boolean pixelsHack)
OMEXMLService.validateOMEXML(String, boolean)
instead.Copyright © 2014 Open Microscopy Environment