|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.FormatTools
public final class FormatTools
A utility class for format reader and writer implementations.
Field Summary | |
---|---|
static int |
CAN_GROUP
|
static int |
CANNOT_GROUP
|
static String |
CHANNEL
Identifies the Channel dimensional type, representing a generic channel dimension. |
static int |
DOUBLE
Identifies the DOUBLE data type used to store pixel values. |
static int |
FLOAT
Identifies the FLOAT data type used to store pixel values. |
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 int |
MUST_GROUP
File grouping options. |
static String |
POLARIZATION
Identifies the Polarization dimensional type, representing a dimension consisting of polarization states. |
static String |
SPECTRA
Identifies the Spectra dimensional type, representing a dimension consisting of spectral channels. |
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. |
Method Summary | |
---|---|
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 |
checkPlaneNumber(IFormatReader r,
int no)
Checks that the given plane number is valid for the given reader. |
static int |
getBytesPerPixel(int pixelType)
Retrieves how many bytes per pixel the current plane or section has. |
static int |
getIndex(IFormatReader reader,
int z,
int c,
int t)
Gets the rasterized index corresponding to the given Z, C and T coordinates. |
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. |
static String |
getPixelTypeString(int pixelType)
Takes a pixel type value and gets a corresponding string representation. |
static int |
getRasterLength(int[] lengths)
Computes the number of raster values for a positional array with the given lengths. |
static int |
getReorderedIndex(IFormatReader r,
String order,
int no)
Converts indices from the given dimension order to the native one. |
static int[] |
getZCTCoords(IFormatReader reader,
int index)
Gets the Z, C and T coordinates corresponding to the given rasterized index value. |
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. |
static int |
pixelTypeFromString(String pixelTypeAsString)
Takes a string value and maps it to one of the pixel type enumerations. |
static void |
populatePixels(MetadataStore store,
IFormatReader r)
Populates the 'pixels' element of the given metadata store, using core metadata from the given reader. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 String CHANNEL
public static final String SPECTRA
public static final String LIFETIME
public static final String POLARIZATION
public static final int MUST_GROUP
public static final int CAN_GROUP
public static final int CANNOT_GROUP
Method Detail |
---|
public static int getIndex(IFormatReader reader, int z, int c, int t)
public static int getIndex(String order, int zSize, int cSize, int tSize, int num, int z, int c, int t)
public static int[] getZCTCoords(IFormatReader reader, int index)
public static int[] getZCTCoords(String order, int zSize, int cSize, int tSize, int num, int index)
public static int getReorderedIndex(IFormatReader r, String order, int no) throws FormatException
FormatException
public static int positionToRaster(int[] lengths, int[] pos)
lengths
- the maximum value for each positional dimensionpos
- position along each dimensional axis
public static int[] rasterToPosition(int[] lengths, int raster)
lengths
- the maximum value at each positional dimensionraster
- rasterized index value
public 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 result
public 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(String)
public static void populatePixels(MetadataStore store, IFormatReader r)
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 checkPlaneNumber(IFormatReader r, int no) throws FormatException
FormatException
public static void checkBufferSize(IFormatReader r, int len) throws FormatException
FormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |