Modifier and Type | Field and Description |
---|---|
static int |
BYTE_TYPE_BINARY |
static int |
BYTE_TYPE_COMPLEX |
static int |
BYTE_TYPE_FLOAT |
static int |
BYTE_TYPE_INTEGER |
static int |
BYTE_TYPE_INTEGER_UNSIGNED |
static int |
BYTE_TYPE_RGB |
static int |
BYTE_TYPE_UNKNOWN |
static int |
COMPRESSION_TYPE_DICOM |
static int |
COMPRESSION_TYPE_DICOM_JPEG_BASELINE |
static int |
COMPRESSION_TYPE_DICOM_JPEG_LOSSLESS |
static int |
COMPRESSION_TYPE_DICOM_JPEG2000 |
static int |
COMPRESSION_TYPE_DICOM_RLE |
static int |
COMPRESSION_TYPE_GZIP |
static int |
COMPRESSION_TYPE_NONE |
Constructor and Description |
---|
ImageType(int numBytes,
int byteType,
int bitsStored,
boolean littleEndian)
The only class constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a copy of this object.
|
static ImageType |
convertToSigned(ImageType it)
Converts datatype from unsigned integer to signed integer.
|
long |
createBitMask()
Returns a bit mask based on the number of bytes and bits stored per voxel.
|
boolean |
equals(Object obj)
Tests equality.
|
int |
getBitsStored()
Returns the number of bits stored.
|
int |
getByteType()
Returns the byte type code.
|
String |
getByteTypeString()
Returns the byte type name.
|
static String |
getByteTypeString(int aByteType)
Returns the byte type name associated with a byte type code.
|
int |
getCompressionType()
Returns the compression type.
|
String |
getCompressionTypeString() |
ImageType |
getNativeType()
If image data was loaded as a different type than what is specified in the header, store the native type here.
|
int |
getNumBytesPerVoxel()
Returns the number of bytes per voxel.
|
double |
getTypeMax(boolean forceAsUnsigned)
Get the maximum value of this type.
|
double |
getTypeMin(boolean forceAsUnsigned)
Get the minimum value of this type.
|
double |
getTypeMin(boolean forceAsUnsigned,
boolean forceAsSigned)
Get the minimum value of this type.
|
static ImageType |
getWorkBufferImageType()
Returns an ImageType which is a 4-byte float, 32 bits stored, and big endian.
|
int |
hashCode()
Computes hash code.
|
boolean |
isAscii()
Returns true if ascii state flag is set.
|
boolean |
isCompressed()
Returns true if this data was compressed.
|
boolean |
isInteger()
Returns true if the byte type is integer.
|
boolean |
isLittleEndian()
Returns the byte order state.
|
boolean |
isRGB() |
boolean |
isRGBBySample()
Returns true if RGB data is stored by sample, rather than location.
|
boolean |
isRGBMode()
Returns true if the RGB data is to interpreted as color rather than intensity.
|
boolean |
isRGBPalette()
Returns true if this data uses a RGB palette.
|
boolean |
isValid()
Use to verify that values are valid.
|
boolean |
isValid(StringBuffer buf)
Returns true if this ImageType is valid, false otherwise.
|
void |
setAscii(boolean bool)
Set the ASCII state flag.
|
void |
setCompressionType(int compression)
Sets the compression type.
|
void |
setNativeType(ImageType nativeType)
Set the native image type.
|
void |
setRGBBySample(boolean isRGBBySample)
Sets whether RGB data is grouped by location or sample.
|
void |
setRGBMode(boolean isRGBMode)
Set to true to interpret this RGB data as color rather than intensity
|
void |
setRGBPalette(boolean isRGBPalette)
Sets to true if this data uses a RGB palette.
|
void |
setValues(ImageType it)
Set the values of this ImageType to that of another.
|
String |
toString()
Returns a string representation of this object.
|
public static final int BYTE_TYPE_BINARY
public static final int BYTE_TYPE_COMPLEX
public static final int BYTE_TYPE_FLOAT
public static final int BYTE_TYPE_INTEGER
public static final int BYTE_TYPE_INTEGER_UNSIGNED
public static final int BYTE_TYPE_RGB
public static final int BYTE_TYPE_UNKNOWN
public static final int COMPRESSION_TYPE_NONE
public static final int COMPRESSION_TYPE_GZIP
public static final int COMPRESSION_TYPE_DICOM
public static final int COMPRESSION_TYPE_DICOM_JPEG_BASELINE
public static final int COMPRESSION_TYPE_DICOM_JPEG_LOSSLESS
public static final int COMPRESSION_TYPE_DICOM_JPEG2000
public static final int COMPRESSION_TYPE_DICOM_RLE
public ImageType(int numBytes, int byteType, int bitsStored, boolean littleEndian)
numBytes
- number of bytes per voxelbyteType
- byte type codebitsStored
- number of bits stored per voxellittleEndian
- byte order of the datapublic static ImageType convertToSigned(ImageType it)
it
- the ImageType objectpublic static String getByteTypeString(int aByteType)
aByteType
- the byte type codepublic static ImageType getWorkBufferImageType()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- clone not supported exceptionpublic long createBitMask()
public boolean equals(Object obj)
public int getBitsStored()
public int getByteType()
public String getByteTypeString()
public String getCompressionTypeString()
public ImageType getNativeType()
public int getNumBytesPerVoxel()
public double getTypeMax(boolean forceAsUnsigned)
forceAsUnsigned
- force method to consider type as unsignedpublic double getTypeMin(boolean forceAsUnsigned)
forceAsUnsigned
- force method to consider type as unsignedpublic double getTypeMin(boolean forceAsUnsigned, boolean forceAsSigned)
forceAsUnsigned
- force method to consider type as unsignedforceAsSigned
- force method to consider type as signedpublic int hashCode()
public boolean isAscii()
public boolean isInteger()
public boolean isLittleEndian()
public boolean isRGB()
public boolean isRGBBySample()
public boolean isRGBMode()
public boolean isRGBPalette()
public boolean isValid()
public boolean isValid(StringBuffer buf)
buf
- StringBuffer to hold messagespublic void setAscii(boolean bool)
bool
- true if data is in ASCII form, false otherwisepublic void setNativeType(ImageType nativeType)
nativeType
- the native image typepublic void setRGBBySample(boolean isRGBBySample)
isRGBBySample
- true if RGB data is grouped by sample, false otherwisepublic void setRGBMode(boolean isRGBMode)
isRGBMode
- true to interpret RGB data as colorpublic void setRGBPalette(boolean isRGBPalette)
isRGBPalette
- true if this data uses a RGB palette, false otherwisepublic void setValues(ImageType it)
it
- replacement ImageType objectpublic String toString()
public boolean isCompressed()
public int getCompressionType()
public void setCompressionType(int compression)
compression
- the compression type