public final class FormatTools extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
ALL_DOMAINS
List of all supported domains.
|
static String |
ASTRONOMY_DOMAIN
Identifies the astronomy domain.
|
static int |
BIT
Identifies the BIT data type used to store pixel values.
|
static int |
CAN_GROUP |
static int |
CANNOT_GROUP |
static String |
CHANNEL
Identifies the Channel dimensional type,
representing a generic channel dimension.
|
static String |
CHANNEL_NAME |
static String |
CHANNEL_NUM |
static String |
CREATOR
Value to use when setting creator/software fields in exported files.
|
static String |
DATE
Date on which this release was built.
|
static int |
DOUBLE
Identifies the DOUBLE data type used to store pixel values.
|
static String |
EM_DOMAIN
Identifies the electron microscopy domain.
|
static String |
FLIM_DOMAIN
Identifies the fluorescence-lifetime domain.
|
static int |
FLOAT
Identifies the FLOAT data type used to store pixel values.
|
static String |
FREQUENCY
Identifies the Frequency dimensional type,
representing a dimension consisting of frequencies.
|
static String |
GEL_DOMAIN
Identifies the gel and blot imaging domain.
|
static String |
GRAPHICS_DOMAIN
Identifies the graphics domain.
|
static String |
HCS_DOMAIN
Identifies the high content screening domain.
|
static String |
HISTOLOGY_DOMAIN
Identifies the histology domain.
|
static String |
ILLUMINATION
Identifies the Illumination dimensional type,
representing a dimension consisting of illuminations.
|
static int |
INT16
Identifies the INT16 data type used to store pixel values.
|
static int |
INT32
Identifies the INT32 data type used to store pixel values.
|
static int |
INT8
Identifies the INT8 data type used to store pixel values.
|
static String |
LIFETIME
Identifies the Lifetime dimensional type,
representing a dimension consisting of a lifetime histogram.
|
static String |
LM_DOMAIN
Identifies the light microscopy domain.
|
protected static org.slf4j.Logger |
LOGGER |
static String |
MEDICAL_DOMAIN
Identifies the medical imaging domain.
|
static int |
MUST_GROUP
File grouping options.
|
static String[] |
NON_GRAPHICS_DOMAINS
List of non-graphics domains.
|
static String[] |
NON_HCS_DOMAINS
List of non-HCS domains.
|
static String[] |
NON_SPECIAL_DOMAINS
List of domains that do not require special handling.
|
static String |
PHASE
Identifies the Phase dimensional type,
representing a dimension consisting of phases.
|
private static String[] |
pixelTypes
Human readable pixel type.
|
static String |
POLARIZATION
Identifies the Polarization dimensional type,
representing a dimension consisting of polarization states.
|
static String |
PROPERTY_FILE
Deprecated.
The property file is no longer used.
|
static String |
ROTATION
Identifies the Rotation dimensional type,
representing a dimension consisting of rotations.
|
static String |
SEM_DOMAIN
Identifies the scanning electron microscopy domain.
|
static String |
SERIES_NAME |
static String |
SERIES_NUM
Patterns to be used when constructing a pattern for output filenames.
|
static String |
SPECTRA
Identifies the Spectra dimensional type,
representing a dimension consisting of spectral channels.
|
static String |
SPM_DOMAIN
Identifies the scanning probe microscopy domain.
|
static String |
T_NUM |
static String |
TILE_NUM |
static String |
TILE_X |
static String |
TILE_Y |
static String |
TIMESTAMP |
static int |
UINT16
Identifies the UINT16 data type used to store pixel values.
|
static int |
UINT32
Identifies the UINT32 data type used to store pixel values.
|
static int |
UINT8
Identifies the UINT8 data type used to store pixel values.
|
static String |
UNKNOWN_DOMAIN
Identifies an unknown domain.
|
static String |
URL_BIO_FORMATS
URL of Bio-Formats web page.
|
static String |
URL_BIO_FORMATS_LIBRARIES
URL of 'Bio-Formats as a Java Library' web page.
|
static String |
URL_OME_TIFF
URL of OME-TIFF web page.
|
static String |
VCS_REVISION
Current VCS revision.
|
static String |
VCS_SHORT_REVISION
Deprecated.
Use the general
VCS_REVISION field. |
static String |
VERSION
Version number of this release.
|
static Properties |
VERSION_PROPERTIES |
static String |
YEAR
Year in which this release was built.
|
static String |
Z_NUM |
Modifier | Constructor and Description |
---|---|
private |
FormatTools() |
Modifier and Type | Method and Description |
---|---|
static void |
assertId(String currentId,
boolean notNull,
int depth)
Asserts that the current file is either null, or not, according to the
given flag.
|
static void |
checkBufferSize(IFormatReader r,
int len) |
static void |
checkBufferSize(IFormatReader r,
int len,
int w,
int h)
Checks that the given buffer size is large enough to hold a w * h
image as returned by the given reader.
|
static void |
checkPlaneNumber(IFormatReader r,
int no)
Checks that the given plane number is valid for the given reader.
|
static void |
checkPlaneParameters(IFormatReader r,
int no,
int bufLength,
int x,
int y,
int w,
int h)
Convenience method for checking that the plane number, tile size and
buffer sizes are all valid for the given reader.
|
static void |
checkTileSize(IFormatReader r,
int x,
int y,
int w,
int h)
Checks that the given tile size is valid for the given reader.
|
static void |
convert(IFormatReader input,
IFormatWriter output,
String outputFile)
Convenience method for writing all of the images and metadata obtained
from the specified IFormatReader into the specified IFormatWriter.
|
static void |
convert(String input,
String output)
Convenience method for converting the specified input file to the
specified output file.
|
static ome.units.quantity.Angle |
createAngle(Double value,
ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit) |
static ome.units.quantity.Angle |
createAngle(Integer value,
ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createAngle(T value,
ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit) |
static ome.units.quantity.ElectricPotential |
createElectricPotential(Double value,
ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit) |
static ome.units.quantity.ElectricPotential |
createElectricPotential(Integer value,
ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createElectricPotential(T value,
ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit) |
static ome.units.quantity.Frequency |
createFrequency(Double value,
ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit) |
static ome.units.quantity.Frequency |
createFrequency(Integer value,
ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createFrequency(T value,
ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit) |
static ome.units.quantity.Length |
createLength(Double value,
ome.units.unit.Unit<ome.units.quantity.Length> valueUnit) |
static ome.units.quantity.Length |
createLength(Integer value,
ome.units.unit.Unit<ome.units.quantity.Length> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createLength(T value,
ome.units.unit.Unit<ome.units.quantity.Length> valueUnit) |
static ome.units.quantity.Power |
createPower(Double value,
ome.units.unit.Unit<ome.units.quantity.Power> valueUnit) |
static ome.units.quantity.Power |
createPower(Integer value,
ome.units.unit.Unit<ome.units.quantity.Power> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createPower(T value,
ome.units.unit.Unit<ome.units.quantity.Power> valueUnit) |
static ome.units.quantity.Pressure |
createPressure(Double value,
ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit) |
static ome.units.quantity.Pressure |
createPressure(Integer value,
ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createPressure(T value,
ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit) |
static ome.units.quantity.Temperature |
createTemperature(Double value,
ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit) |
static ome.units.quantity.Temperature |
createTemperature(Integer value,
ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createTemperature(T value,
ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit) |
static ome.units.quantity.Time |
createTime(Double value,
ome.units.unit.Unit<ome.units.quantity.Time> valueUnit) |
static ome.units.quantity.Time |
createTime(Integer value,
ome.units.unit.Unit<ome.units.quantity.Time> valueUnit) |
static <T extends ome.xml.model.primitives.PrimitiveNumber> |
createTime(T value,
ome.units.unit.Unit<ome.units.quantity.Time> valueUnit) |
static long[] |
defaultMinMax(int pixelType)
Get the default range for the specified pixel type.
|
static boolean |
equalReaders(IFormatReader a,
IFormatReader b)
Check if the two given readers are equal.
|
static int |
getBytesPerPixel(int pixelType)
Retrieves how many bytes per pixel the current plane or section has.
|
static int |
getBytesPerPixel(String pixelType)
Retrieves the number of bytes per pixel in the current plane.
|
static ome.units.quantity.Length |
getCutIn(Double value) |
static ome.units.quantity.Length |
getCutOut(Double value) |
static ome.units.quantity.Length |
getEmissionWavelength(Double value) |
static ome.units.quantity.Length |
getExcitationWavelength(Double value) |
static String |
getFilename(int series,
int image,
IFormatReader r,
String pattern) |
static String |
getFilename(int series,
int image,
IFormatReader r,
String pattern,
boolean padded) |
static String |
getFilename(int series,
int image,
MetadataRetrieve retrieve,
String pattern,
boolean padded) |
static String[] |
getFilenames(String pattern,
IFormatReader r) |
static ome.units.quantity.Length |
getFontSize(Integer value) |
static int |
getImagesPerFile(String pattern,
IFormatReader r) |
static int |
getIndex(IFormatReader reader,
int z,
int c,
int t)
Gets the rasterized index corresponding
to the given Z, C and T coordinates (real sizes).
|
static int |
getIndex(IFormatReader reader,
int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
Gets the rasterized index corresponding to the given Z, C, T,
ModuloZ, ModuloC and ModuloT coordinates (effective sizes).
|
static int |
getIndex(String order,
int zSize,
int cSize,
int tSize,
int num,
int z,
int c,
int t)
Gets the rasterized index corresponding
to the given Z, C and T coordinates (real sizes).
|
static int |
getIndex(String order,
int zSize,
int cSize,
int tSize,
int moduloZSize,
int moduloCSize,
int moduloTSize,
int num,
int z,
int c,
int t,
int moduloZ,
int moduloC,
int moduloT)
Gets the rasterized index corresponding to the given Z, C, T,
ModuloZ, ModuloC, ModuloT coordinates (effective sizes).
|
static ome.xml.model.primitives.PositiveInteger |
getMaxFieldCount(Integer value) |
static ome.units.quantity.Length |
getPhysicalSize(Double value,
String unit) |
static ome.units.quantity.Length |
getPhysicalSizeX(Double value)
Formats the input value for the physical size in X into a length in
microns
|
static ome.units.quantity.Length |
getPhysicalSizeX(Double value,
String unit)
Formats the input value for the physical size in X into a length of the
given unit.
|
static ome.units.quantity.Length |
getPhysicalSizeX(Double value,
ome.units.unit.Unit<ome.units.quantity.Length> unit)
Formats the input value for the physical size in X into a length of the
given unit.
|
static ome.units.quantity.Length |
getPhysicalSizeY(Double value)
Formats the input value for the physical size in Y into a length in
microns
|
static ome.units.quantity.Length |
getPhysicalSizeY(Double value,
String unit)
Formats the input value for the physical size in Y into a length of the
given unit.
|
static ome.units.quantity.Length |
getPhysicalSizeY(Double value,
ome.units.unit.Unit<ome.units.quantity.Length> unit)
Formats the input value for the physical size in Y into a length of the
given unit.
|
static ome.units.quantity.Length |
getPhysicalSizeZ(Double value)
Formats the input value for the physical size in Z into a length in
microns.
|
static ome.units.quantity.Length |
getPhysicalSizeZ(Double value,
String unit)
Formats the input value for the physical size in Z into a length of the
given unit.
|
static ome.units.quantity.Length |
getPhysicalSizeZ(Double value,
ome.units.unit.Unit<ome.units.quantity.Length> unit)
Formats the input value for the physical size in Z into a length of the
given unit.
|
static String |
getPixelTypeString(int pixelType)
Takes a pixel type value and gets a corresponding string representation.
|
static int |
getPlaneSize(IFormatReader r)
Returns the size in bytes of a single plane.
|
static int |
getPlaneSize(IFormatReader r,
int w,
int h)
Returns the size in bytes of a w * h tile.
|
static int |
getRasterLength(int[] lengths)
Computes the number of raster values for a positional array
with the given lengths.
|
static IFormatReader |
getReader(IFormatReader r,
Class<? extends IFormatReader> c)
Recursively look for the first underlying reader that is an
instance of the given class.
|
static int |
getReorderedIndex(IFormatReader reader,
String newOrder,
int newIndex)
Converts index from the given dimension order to the reader's native one.
|
static int |
getReorderedIndex(String origOrder,
String newOrder,
int zSize,
int cSize,
int tSize,
int num,
int newIndex)
Converts index from one dimension order to another.
|
static ome.units.quantity.Length |
getStagePosition(Double value,
String unit)
Formats the input value for the stage position into a length of the given
unit.
|
static ome.units.quantity.Length |
getStagePosition(Double value,
ome.units.unit.Unit<ome.units.quantity.Length> unit)
Formats the input value for the stage position into a length of the given
unit.
|
static String |
getTileFilename(int tileX,
int tileY,
int tileIndex,
String pattern) |
static ome.units.quantity.Time |
getTime(Double value,
String unit)
Formats the input value for the time into a length of the
given unit.
|
static ome.units.quantity.Length |
getWavelength(Double value) |
static ome.units.quantity.Length |
getWavelength(Double value,
String unit)
Formats the input value for the wavelength into a length of the
given unit.
|
static int[] |
getZCTCoords(IFormatReader reader,
int index)
Gets the Z, C and T coordinates corresponding
to the given rasterized index value (real sizes).
|
static int[] |
getZCTCoords(String order,
int zSize,
int cSize,
int tSize,
int num,
int index)
Gets the Z, C and T coordinates corresponding to the given rasterized
index value (real sizes).
|
static int[] |
getZCTCoords(String order,
int zSize,
int cSize,
int tSize,
int moduloZSize,
int moduloCSize,
int moduloTSize,
int num,
int index)
Gets the Z, C and T coordinates corresponding to the given
rasterized index value.
|
static int[] |
getZCTModuloCoords(IFormatReader reader,
int index)
Gets the Z, C, T, ModuloZ, ModuloC and ModuloZ coordinates
corresponding to the given rasterized index value (effective
sizes).
|
static boolean |
isFloatingPoint(IFormatReader reader)
Determines whether the given reader represents any floating point data.
|
static boolean |
isFloatingPoint(int pixelType)
Determines whether the given pixel type is floating point or integer.
|
static boolean |
isPositiveValue(Double value) |
static boolean |
isSigned(int pixelType)
Determines whether the given pixel type is signed or unsigned.
|
private static Manifest |
loadManifest() |
(package private) static Properties |
loadProperties()
Deprecated.
This method should no longer be used. The properties
are now obtained from the jar manifest.
|
(package private) static String[] |
makePixelTypes() |
static byte[] |
openThumbBytes(IFormatReader reader,
int no)
Default implementation for
IFormatReader.openThumbBytes(int) . |
static int |
pixelTypeFromBytes(int bytes,
boolean signed,
boolean fp)
Returns an appropriate pixel type given the number of bytes per pixel.
|
static int |
pixelTypeFromString(String pixelTypeAsString)
Takes a string value and maps it to one of the pixel type enumerations.
|
static int |
positionToRaster(int[] lengths,
int[] pos)
Computes a unique 1-D index corresponding
to the given multidimensional position.
|
static int[] |
rasterToPosition(int[] lengths,
int raster)
Computes a unique N-D position corresponding
to the given rasterized index value.
|
static int[] |
rasterToPosition(int[] lengths,
int raster,
int[] pos)
Computes a unique N-D position corresponding
to the given rasterized index value.
|
static boolean |
validStream(loci.common.RandomAccessInputStream stream,
int len,
boolean littleEndian)
Returns true if the given RandomAccessInputStream conatins at least
'len' bytes.
|
protected static final org.slf4j.Logger LOGGER
public static final int INT8
public static final int UINT8
public static final int INT16
public static final int UINT16
public static final int INT32
public static final int UINT32
public static final int FLOAT
public static final int DOUBLE
public static final int BIT
private static final String[] pixelTypes
public static final String CHANNEL
public static final String SPECTRA
public static final String LIFETIME
public static final String POLARIZATION
public static final String PHASE
public static final String FREQUENCY
public static final String ROTATION
public static final String ILLUMINATION
public static final int MUST_GROUP
public static final int CAN_GROUP
public static final int CANNOT_GROUP
public static final String SERIES_NUM
public static final String SERIES_NAME
public static final String CHANNEL_NUM
public static final String CHANNEL_NAME
public static final String Z_NUM
public static final String T_NUM
public static final String TIMESTAMP
public static final String TILE_X
public static final String TILE_Y
public static final String TILE_NUM
public static final Properties VERSION_PROPERTIES
public static final String VCS_REVISION
@Deprecated public static final String VCS_SHORT_REVISION
VCS_REVISION
field.public static final String DATE
public static final String YEAR
public static final String VERSION
public static final String CREATOR
@Deprecated public static final String PROPERTY_FILE
public static final String HCS_DOMAIN
public static final String LM_DOMAIN
public static final String EM_DOMAIN
public static final String SPM_DOMAIN
public static final String SEM_DOMAIN
public static final String FLIM_DOMAIN
public static final String MEDICAL_DOMAIN
public static final String HISTOLOGY_DOMAIN
public static final String GEL_DOMAIN
public static final String ASTRONOMY_DOMAIN
public static final String GRAPHICS_DOMAIN
public static final String UNKNOWN_DOMAIN
public static final String[] NON_GRAPHICS_DOMAINS
public static final String[] NON_HCS_DOMAINS
public static final String[] NON_SPECIAL_DOMAINS
GRAPHICS_DOMAIN
and
HCS_DOMAIN
.public static final String[] ALL_DOMAINS
public static final String URL_BIO_FORMATS
public static final String URL_BIO_FORMATS_LIBRARIES
public static final String URL_OME_TIFF
static String[] makePixelTypes()
@Deprecated static Properties loadProperties()
private static Manifest loadManifest()
public static int getIndex(IFormatReader reader, int z, int c, int t)
public static int getIndex(IFormatReader reader, int z, int c, int t, int moduloZ, int moduloC, int moduloT)
public static int getIndex(String order, int zSize, int cSize, int tSize, int num, int z, int c, int t)
order
- Dimension order.zSize
- Total number of focal planes (real size).cSize
- Total number of channels (real size).tSize
- Total number of time points (real size).num
- Total number of image planes (zSize * cSize * tSize),
specified as a consistency check.z
- Z coordinate of ZCT coordinate triple to convert to 1D index (real size).c
- C coordinate of ZCT coordinate triple to convert to 1D index (real size).t
- T coordinate of ZCT coordinate triple to convert to 1D index (real size).public static int getIndex(String order, int zSize, int cSize, int tSize, int moduloZSize, int moduloCSize, int moduloTSize, int num, int z, int c, int t, int moduloZ, int moduloC, int moduloT)
order
- Dimension order.zSize
- Total number of focal planes (real size).cSize
- Total number of channels (real size).tSize
- Total number of time points (real size).moduloZSize
- Total number of ModuloZ planes (real size).moduloCSize
- Total number of ModuloC planes (real size).moduloTSize
- Total number of ModuloT planes (real size).num
- Total number of image planes (zSize * cSize * tSize),
specified as a consistency check.z
- Z coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).c
- C coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).t
- T coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).moduloZ
- ModuloZ coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).moduloC
- ModuloC coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).moduloT
- ModuloT coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).public static int[] getZCTCoords(IFormatReader reader, int index)
public static int[] getZCTModuloCoords(IFormatReader reader, int index)
public static int[] getZCTCoords(String order, int zSize, int cSize, int tSize, int num, int index)
order
- Dimension order.zSize
- Total number of focal planes (real size).cSize
- Total number of channels (real size).tSize
- Total number of time points (real size).num
- Total number of image planes (zSize * cSize * tSize),
specified as a consistency check.index
- 1D (rasterized) index to convert to ZCT coordinate triple.public static int[] getZCTCoords(String order, int zSize, int cSize, int tSize, int moduloZSize, int moduloCSize, int moduloTSize, int num, int index)
order
- Dimension order.zSize
- Total number of focal planes (real size).cSize
- Total number of channels (real size).tSize
- Total number of time points (real size).moduloZSize
- Total number of ModuloZ planes (real size).moduloCSize
- Total number of ModuloC planes (real size).moduloTSize
- Total number of ModuloT planes (real size).num
- Total number of image planes (zSize * cSize * tSize),
specified as a consistency check.index
- 1D (rasterized) index to convert to ZCT coordinate triple.public static int getReorderedIndex(IFormatReader reader, String newOrder, int newIndex) throws FormatException
DimensionSwapper
does).FormatException
- Never actually thrown.public static int getReorderedIndex(String origOrder, String newOrder, int zSize, int cSize, int tSize, int num, int newIndex)
DimensionSwapper
does).origOrder
- Original dimension order.newOrder
- New dimension order.zSize
- Total number of focal planes (real size).cSize
- Total number of channels (real size).tSize
- Total number of time points (real size).num
- Total number of image planes (zSize * cSize * tSize),
specified as a consistency check.newIndex
- 1D (rasterized) index according to new dimension order.public static int positionToRaster(int[] lengths, int[] pos)
lengths
- the maximum value for each positional dimensionpos
- position along each dimensional axispublic static int[] rasterToPosition(int[] lengths, int raster)
lengths
- the maximum value at each positional dimensionraster
- rasterized index valuepublic static int[] rasterToPosition(int[] lengths, int raster, int[] pos)
lengths
- the maximum value at each positional dimensionraster
- rasterized index valuepos
- preallocated position array to populate with the resultpublic static int getRasterLength(int[] lengths)
public static int pixelTypeFromString(String pixelTypeAsString)
pixelTypeAsString
- the pixel type as a string.public static String getPixelTypeString(int pixelType)
pixelType
- the pixel type.public static int getBytesPerPixel(int pixelType)
pixelType
- the pixel type as retrieved from
IFormatReader.getPixelType()
.IFormatReader.getPixelType()
public static int getBytesPerPixel(String pixelType)
pixelType
- the pixel type, as a String.pixelTypeFromString(String)
,
getBytesPerPixel(int)
public static boolean isFloatingPoint(IFormatReader reader)
reader
- the reader to checkisFloatingPoint(int)
public static boolean isFloatingPoint(int pixelType)
pixelType
- the pixel type as retrieved from
IFormatReader.getPixelType()
.IFormatReader.getPixelType()
public static boolean isSigned(int pixelType)
pixelType
- the pixel type as retrieved from
IFormatReader.getPixelType()
.IFormatReader.getPixelType()
public static int pixelTypeFromBytes(int bytes, boolean signed, boolean fp) throws FormatException
bytes
- number of bytes per pixel.signed
- whether or not the pixel type should be signed.fp
- whether or not these are floating point pixels.FormatException
public static void assertId(String currentId, boolean notNull, int depth)
currentId
- File name to test.notNull
- True iff id should be non-null.depth
- How far back in the stack the calling method is; this name
is reported as part of the exception message, if available. Use zero
to suppress output of the calling method name.public static void checkPlaneParameters(IFormatReader r, int no, int bufLength, int x, int y, int w, int h) throws FormatException
FormatException
public static void checkPlaneNumber(IFormatReader r, int no) throws FormatException
FormatException
public static void checkTileSize(IFormatReader r, int x, int y, int w, int h) throws FormatException
FormatException
public static void checkBufferSize(IFormatReader r, int len) throws FormatException
FormatException
public static void checkBufferSize(IFormatReader r, int len, int w, int h) throws FormatException
FormatException
- if the buffer is too smallpublic static boolean validStream(loci.common.RandomAccessInputStream stream, int len, boolean littleEndian) throws IOException
IOException
public static int getPlaneSize(IFormatReader r)
public static int getPlaneSize(IFormatReader r, int w, int h)
public static String getTileFilename(int tileX, int tileY, int tileIndex, String pattern)
public static String getFilename(int series, int image, IFormatReader r, String pattern) throws FormatException, IOException
FormatException
- Never actually thrown.IOException
- Never actually thrown.public static String getFilename(int series, int image, IFormatReader r, String pattern, boolean padded) throws FormatException, IOException
FormatException
- Never actually thrown.IOException
- Never actually thrown.public static String getFilename(int series, int image, MetadataRetrieve retrieve, String pattern, boolean padded) throws FormatException, IOException
FormatException
IOException
public static String[] getFilenames(String pattern, IFormatReader r) throws FormatException, IOException
FormatException
IOException
public static int getImagesPerFile(String pattern, IFormatReader r) throws FormatException, IOException
FormatException
IOException
public static IFormatReader getReader(IFormatReader r, Class<? extends IFormatReader> c)
public static boolean equalReaders(IFormatReader a, IFormatReader b)
public static byte[] openThumbBytes(IFormatReader reader, int no) throws FormatException, IOException
IFormatReader.openThumbBytes(int)
.
At the moment, it uses BufferedImage
objects
to resize thumbnails, so it is not safe for use in headless contexts.
In the future, we may reimplement the image scaling logic purely with
byte arrays, but handling every case would be substantial effort, so
doing so is currently a low priority item.FormatException
IOException
public static void convert(String input, String output) throws FormatException, IOException
input
- the full path name of the existing input fileoutput
- the full path name of the output file to be createdFormatException
- if there is a general problem reading from or
writing to one of the files.IOException
- if there is an I/O-related error.convert(IFormatReader, IFormatWriter, String).
public static void convert(IFormatReader input, IFormatWriter output, String outputFile) throws FormatException, IOException
input
- the pre-initialized IFormatReader used for reading data.output
- the uninitialized IFormatWriter used for writing data.outputFile
- the full path name of the output file to be created.FormatException
- if there is a general problem reading from or
writing to one of the files.IOException
- if there is an I/O-related error.public static long[] defaultMinMax(int pixelType)
pixelType
- the pixel type.IOException
- if the pixel type is floating point or invalid.public static boolean isPositiveValue(Double value)
public static ome.units.quantity.Length getWavelength(Double value, String unit)
value
- the value of the wavelengthunit
- the unit of the wavelength. If null will default to NanometreLength
public static ome.units.quantity.Time getTime(Double value, String unit)
value
- the value of the timeunit
- the unit of the time. If null will default to SecondsLength
public static ome.units.quantity.Length getStagePosition(Double value, ome.units.unit.Unit<ome.units.quantity.Length> unit)
value
- the value of the stage positionunit
- the unit of the stage positionLength
. Returns
null
if value
is null
or infinite
or unit
is null
.public static ome.units.quantity.Length getStagePosition(Double value, String unit)
value
- the value of the stage positionunit
- the unit of the stage position. If the string cannot be
converted into a base length unit, the stage position length
will be constructure using the default reference frame unit.Length
. Returns
null
under the same conditions as
getStagePosition(Double, String)
.public static ome.units.quantity.Length getPhysicalSizeX(Double value)
value
- the value of the physical size in X in micronsLength
public static ome.units.quantity.Length getPhysicalSizeX(Double value, String unit)
value
- the value of the physical size in Xunit
- the unit of the physical size in X. If null
,
default to microns.Length
public static ome.units.quantity.Length getPhysicalSizeX(Double value, ome.units.unit.Unit<ome.units.quantity.Length> unit)
value
- the value of the physical size in Xunit
- the unit of the physical size in XLength
public static ome.units.quantity.Length getPhysicalSizeY(Double value)
value
- the value of the physical size in Y in micronsLength
public static ome.units.quantity.Length getPhysicalSizeY(Double value, String unit)
value
- the value of the physical size in Yunit
- the unit of the physical size in Y. If null
,
default to microns.Length
public static ome.units.quantity.Length getPhysicalSizeY(Double value, ome.units.unit.Unit<ome.units.quantity.Length> unit)
value
- the value of the physical size in Yunit
- the unit of the physical size in YLength
public static ome.units.quantity.Length getPhysicalSizeZ(Double value)
value
- the value of the physical size in Z in micronsLength
public static ome.units.quantity.Length getPhysicalSizeZ(Double value, String unit)
value
- the value of the physical size in Zunit
- the unit of the physical size in Z. If null
,
default to microns.Length
public static ome.units.quantity.Length getPhysicalSizeZ(Double value, ome.units.unit.Unit<ome.units.quantity.Length> unit)
value
- the value of the physical size in Zunit
- the unit of the physical size in ZLength
public static ome.units.quantity.Length getEmissionWavelength(Double value)
public static ome.units.quantity.Length getExcitationWavelength(Double value)
public static ome.units.quantity.Length getWavelength(Double value)
public static ome.xml.model.primitives.PositiveInteger getMaxFieldCount(Integer value)
public static ome.units.quantity.Length getCutIn(Double value)
public static ome.units.quantity.Length getCutOut(Double value)
public static ome.units.quantity.Length getFontSize(Integer value)
public static ome.units.quantity.Angle createAngle(Double value, ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit)
public static ome.units.quantity.Angle createAngle(Integer value, ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Angle createAngle(T value, ome.units.unit.Unit<ome.units.quantity.Angle> valueUnit)
public static ome.units.quantity.ElectricPotential createElectricPotential(Double value, ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit)
public static ome.units.quantity.ElectricPotential createElectricPotential(Integer value, ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.ElectricPotential createElectricPotential(T value, ome.units.unit.Unit<ome.units.quantity.ElectricPotential> valueUnit)
public static ome.units.quantity.Frequency createFrequency(Double value, ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit)
public static ome.units.quantity.Frequency createFrequency(Integer value, ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Frequency createFrequency(T value, ome.units.unit.Unit<ome.units.quantity.Frequency> valueUnit)
public static ome.units.quantity.Power createPower(Double value, ome.units.unit.Unit<ome.units.quantity.Power> valueUnit)
public static ome.units.quantity.Power createPower(Integer value, ome.units.unit.Unit<ome.units.quantity.Power> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Power createPower(T value, ome.units.unit.Unit<ome.units.quantity.Power> valueUnit)
public static ome.units.quantity.Length createLength(Double value, ome.units.unit.Unit<ome.units.quantity.Length> valueUnit)
public static ome.units.quantity.Length createLength(Integer value, ome.units.unit.Unit<ome.units.quantity.Length> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Length createLength(T value, ome.units.unit.Unit<ome.units.quantity.Length> valueUnit)
public static ome.units.quantity.Pressure createPressure(Double value, ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit)
public static ome.units.quantity.Pressure createPressure(Integer value, ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Pressure createPressure(T value, ome.units.unit.Unit<ome.units.quantity.Pressure> valueUnit)
public static ome.units.quantity.Temperature createTemperature(Double value, ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit)
public static ome.units.quantity.Temperature createTemperature(Integer value, ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Temperature createTemperature(T value, ome.units.unit.Unit<ome.units.quantity.Temperature> valueUnit)
public static ome.units.quantity.Time createTime(Double value, ome.units.unit.Unit<ome.units.quantity.Time> valueUnit)
public static ome.units.quantity.Time createTime(Integer value, ome.units.unit.Unit<ome.units.quantity.Time> valueUnit)
public static <T extends ome.xml.model.primitives.PrimitiveNumber> ome.units.quantity.Time createTime(T value, ome.units.unit.Unit<ome.units.quantity.Time> valueUnit)
Copyright © 2017 Open Microscopy Environment