public class MetaDataUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CHANNEL_NAME |
Constructor and Description |
---|
MetaDataUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
clean(loci.formats.ome.OMEXMLMetadataImpl metaData)
Cleanup the meta data (sometime we have empty data structure sitting there)
|
static loci.formats.ome.OMEXMLMetadataImpl |
createDefaultMetadata(java.lang.String name)
Create and return a default OME Metadata object with default image name.
|
static loci.formats.ome.OMEXMLMetadataImpl |
createOMEMetadata(loci.formats.meta.MetadataRetrieve metadata,
int serie)
Deprecated.
|
static ome.xml.model.Channel |
ensureChannel(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int index)
Ensure the channel at specified index exist for the specified image serie.
|
static ome.xml.model.Channel |
ensureChannel(ome.xml.model.Pixels pix,
int index)
Ensure the channel at specified index exist for the specified image serie.
|
static ome.xml.model.Pixels |
ensurePixels(ome.xml.model.OME ome,
int index)
Ensure the pixels at specified index exist for the specified metaData description.
|
static ome.xml.model.Image |
ensureSerie(ome.xml.model.OME ome,
int index)
Ensure the image serie at specified index exist for the specified metaData description.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(IcyBufferedImage image,
boolean separateChannel)
Generates Meta Data for the given BufferedImage.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(int sizeX,
int sizeY,
int sizeC,
DataType dataType,
boolean separateChannel)
Generates Meta Data for the given arguments.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(int sizeX,
int sizeY,
int sizeC,
int sizeZ,
int sizeT,
DataType dataType,
boolean separateChannel)
Generates meta data for the given image properties.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(Sequence sequence,
boolean separateChannel)
Generates Meta Data for the given Sequence.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(Sequence sequence,
boolean useZ,
boolean useT,
boolean separateChannel)
Generates Meta Data for the given Sequence and parameters.
|
static loci.formats.ome.OMEXMLMetadata |
generateMetaData(Sequence sequence,
int sizeZ,
int sizeT,
boolean separateChannel)
Generates Meta Data for the given Sequence and parameters.
|
static ome.xml.model.Channel |
getChannel(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int index)
Return channel object at specified index for the specified image serie.
|
static java.awt.Color |
getChannelColor(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int channel)
Returns Color of specified channel image serie.
|
static java.lang.String |
getChannelName(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int channel)
Returns name of specified channel image serie.
|
static DataType |
getDataType(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the data type of the specified image serie.
|
static java.lang.String |
getDefaultChannelName(int channel)
Get default name for specified channel.
|
static java.lang.String |
getImageID(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the id of the specified image serie.
|
static java.lang.String |
getName(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the name of the specified image serie.
|
static int |
getNumChannel(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the number of channel for the specified image serie in metaData description.
|
static int |
getNumSerie(loci.formats.ome.OMEXMLMetadataImpl metaData)
Returns the number of image serie of the specified metaData description.
|
static ome.xml.model.OME |
getOME(loci.formats.ome.OMEXMLMetadataImpl metaData)
Returns OME root element (create it if needed).
|
static ome.xml.model.Pixels |
getPixels(loci.formats.ome.OMEXMLMetadataImpl metaData,
int index)
Return pixels object at specified index for the specified metaData description.
|
static double |
getPixelSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double defaultValue)
Returns X pixel size (in µm) of the specified image serie.
|
static double |
getPixelSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double defaultValue)
Returns Y pixel size (in µm) of the specified image serie.
|
static double |
getPixelSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double defaultValue)
Returns Z pixel size (in µm) of the specified image serie.
|
static ome.xml.model.Image |
getSerie(loci.formats.ome.OMEXMLMetadataImpl metaData,
int index)
Return image serie object at specified index for the specified metaData description.
|
static int |
getSizeC(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the number of channel (sizeC) of the specified image serie.
|
static int |
getSizeT(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the number of frame (sizeT) of the specified image serie.
|
static int |
getSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the width (sizeX) of the specified image serie.
|
static int |
getSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the height (sizeY) of the specified image serie.
|
static int |
getSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie)
Returns the depth (sizeZ) of the specified image serie.
|
static double |
getTimeInterval(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double defaultValue)
Returns T time size (in second) of the specified image serie.
|
static boolean |
isEmpty(ome.xml.model.XMLAnnotation xmlAnnotation)
Returns
true if the specified XML annotation are empty. |
static void |
keepSingleSerie(loci.formats.ome.OMEXMLMetadataImpl metaData,
int num)
Keep only the specified image serie.
|
static void |
removeChannel(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int index)
Remove a channel for the specified image serie.
|
static void |
removeChannel(ome.xml.model.Pixels pix,
int index)
Remove a channel from the specified Pixels object.
|
static void |
setChannelName(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int channel,
java.lang.String value)
Set name of specified channel image serie.
|
static void |
setDataType(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
DataType dataType)
Sets the data type of the specified image serie.
|
static void |
setImageID(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
java.lang.String value)
Set the id of the specified image serie.
|
static void |
setMetaData(loci.formats.ome.OMEXMLMetadataImpl metadata,
int sizeX,
int sizeY,
int sizeC,
int sizeZ,
int sizeT,
DataType dataType,
boolean separateChannel)
Set metadata object with the given image properties.
|
static void |
setName(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
java.lang.String value)
Set the name of the specified image serie.
|
static void |
setNumChannel(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int num)
Set the number of channel for the specified image serie in metaData description.
|
static void |
setNumSerie(loci.formats.ome.OMEXMLMetadataImpl metaData,
int num)
Set the number of image serie for the specified metaData description.
|
static void |
setPixelSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double value)
Set X pixel size (in µm) of the specified image serie.
|
static void |
setPixelSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double value)
Set Y pixel size (in µm) of the specified image serie.
|
static void |
setPixelSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double value)
Set Z pixel size (in µm) of the specified image serie.
|
static void |
setSizeC(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int sizeC)
Sets the number of channel (sizeC) of the specified image serie.
|
static void |
setSizeT(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int sizeT)
Sets the number of frame (sizeT) of the specified image serie.
|
static void |
setSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int sizeX)
Sets the width (sizeX) of the specified image serie.
|
static void |
setSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int sizeY)
Sets the height (sizeY) of the specified image serie.
|
static void |
setSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
int sizeZ)
Sets the depth (sizeZ) of the specified image serie.
|
static void |
setTimeInterval(loci.formats.ome.OMEXMLMetadataImpl metaData,
int serie,
double value)
Set T time resolution (in second) of the specified image serie.
|
public static final java.lang.String DEFAULT_CHANNEL_NAME
public MetaDataUtil()
public static ome.xml.model.OME getOME(loci.formats.ome.OMEXMLMetadataImpl metaData)
public static int getNumSerie(loci.formats.ome.OMEXMLMetadataImpl metaData)
public static ome.xml.model.Image getSerie(loci.formats.ome.OMEXMLMetadataImpl metaData, int index)
public static ome.xml.model.Image ensureSerie(ome.xml.model.OME ome, int index)
public static void setNumSerie(loci.formats.ome.OMEXMLMetadataImpl metaData, int num)
public static ome.xml.model.Pixels getPixels(loci.formats.ome.OMEXMLMetadataImpl metaData, int index)
public static ome.xml.model.Pixels ensurePixels(ome.xml.model.OME ome, int index)
public static DataType getDataType(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static int getSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static int getSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static int getSizeC(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static int getSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static int getSizeT(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static void setDataType(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, DataType dataType)
public static void setSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int sizeX)
public static void setSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int sizeY)
public static void setSizeC(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int sizeC)
public static void setSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int sizeZ)
public static void setSizeT(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int sizeT)
public static java.lang.String getImageID(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static void setImageID(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, java.lang.String value)
public static java.lang.String getName(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static void setName(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, java.lang.String value)
public static double getPixelSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double defaultValue)
public static double getPixelSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double defaultValue)
public static double getPixelSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double defaultValue)
public static double getTimeInterval(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double defaultValue)
public static void setPixelSizeX(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double value)
public static void setPixelSizeY(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double value)
public static void setPixelSizeZ(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double value)
public static void setTimeInterval(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, double value)
public static java.lang.String getDefaultChannelName(int channel)
public static int getNumChannel(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie)
public static ome.xml.model.Channel getChannel(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int index)
public static ome.xml.model.Channel ensureChannel(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int index)
public static ome.xml.model.Channel ensureChannel(ome.xml.model.Pixels pix, int index)
public static void removeChannel(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int index)
public static void removeChannel(ome.xml.model.Pixels pix, int index)
public static void setNumChannel(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int num)
getSizeC(OMEXMLMetadataImpl, int)
.public static java.lang.String getChannelName(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int channel)
public static void setChannelName(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int channel, java.lang.String value)
public static java.awt.Color getChannelColor(loci.formats.ome.OMEXMLMetadataImpl metaData, int serie, int channel)
public static loci.formats.ome.OMEXMLMetadataImpl createDefaultMetadata(java.lang.String name)
@Deprecated public static loci.formats.ome.OMEXMLMetadataImpl createOMEMetadata(loci.formats.meta.MetadataRetrieve metadata, int serie)
OMEUtil.createOMEMetadata(MetadataRetrieve, int)
public static void setMetaData(loci.formats.ome.OMEXMLMetadataImpl metadata, int sizeX, int sizeY, int sizeC, int sizeZ, int sizeT, DataType dataType, boolean separateChannel) throws loci.common.services.ServiceException
metadata
- metadata object to fill.sizeX
- width in pixels.sizeY
- height in pixels.sizeC
- number of channel.sizeZ
- number of Z slices.sizeT
- number of T frames.dataType
- data type.separateChannel
- true if we want channel data to be separated.loci.common.services.ServiceException
public static loci.formats.ome.OMEXMLMetadata generateMetaData(int sizeX, int sizeY, int sizeC, int sizeZ, int sizeT, DataType dataType, boolean separateChannel) throws loci.common.services.ServiceException
sizeX
- width in pixels.sizeY
- height in pixels.sizeC
- number of channel.sizeZ
- number of Z slices.sizeT
- number of T frames.dataType
- data type.separateChannel
- true if we want channel data to be separated.loci.common.services.ServiceException
public static loci.formats.ome.OMEXMLMetadata generateMetaData(int sizeX, int sizeY, int sizeC, DataType dataType, boolean separateChannel) throws loci.common.services.ServiceException
loci.common.services.ServiceException
setMetaData(OMEXMLMetadataImpl, int, int, int, int, int, DataType, boolean)
public static loci.formats.ome.OMEXMLMetadata generateMetaData(IcyBufferedImage image, boolean separateChannel) throws loci.common.services.ServiceException
loci.common.services.ServiceException
setMetaData(OMEXMLMetadataImpl, int, int, int, int, int, DataType, boolean)
public static loci.formats.ome.OMEXMLMetadata generateMetaData(Sequence sequence, boolean useZ, boolean useT, boolean separateChannel) throws loci.common.services.ServiceException
loci.common.services.ServiceException
setMetaData(OMEXMLMetadataImpl, int, int, int, int, int, DataType, boolean)
public static loci.formats.ome.OMEXMLMetadata generateMetaData(Sequence sequence, int sizeZ, int sizeT, boolean separateChannel) throws loci.common.services.ServiceException
loci.common.services.ServiceException
setMetaData(OMEXMLMetadataImpl, int, int, int, int, int, DataType, boolean)
public static loci.formats.ome.OMEXMLMetadata generateMetaData(Sequence sequence, boolean separateChannel) throws loci.common.services.ServiceException
loci.common.services.ServiceException
setMetaData(OMEXMLMetadataImpl, int, int, int, int, int, DataType, boolean)
public static void keepSingleSerie(loci.formats.ome.OMEXMLMetadataImpl metaData, int num)
public static void clean(loci.formats.ome.OMEXMLMetadataImpl metaData)
public static boolean isEmpty(ome.xml.model.XMLAnnotation xmlAnnotation)
true
if the specified XML annotation are empty.