Class VoxelDataType
Object
org.anchoranalysis.image.voxel.datatype.VoxelDataType
- Direct Known Subclasses:
FloatVoxelType,SignedVoxelType,UnsignedVoxelType
public abstract class VoxelDataType extends Object
The type of data that a single voxel represents in an image or related buffer.
- Author:
- Owen Feehan
-
Field Summary
Fields Modifier and Type Field Description static longVALUE_NOT_COMPATIBLEA placeholder value formaxValueorminValueif the true maximum or minimum value cannot be expressed as a long. -
Constructor Summary
Constructors Constructor Description VoxelDataType(int bitDepth, String typeIdentifier, long maxValue, long minValue) -
Method Summary
Modifier and Type Method Description intbitDepth()The number of bits required to represent a voxel.booleanequals(Object obj)inthashCode()abstract booleanisInteger()Whether the data-type represents an integer or floating-point?abstract booleanisUnsigned()Whether the data-type is unsigned?longmaxValue()The maximum value this type can represent, orVALUE_NOT_COMPATIBLEif it cannot be represented in a long.longminValue()The minimum value this type can represent, orVALUE_NOT_COMPATIBLEif it cannot be represented in a long.intnumberBytes()The number of bytes needed to represent this data-type.StringtoString()
-
Field Details
-
VALUE_NOT_COMPATIBLE
public static final long VALUE_NOT_COMPATIBLEA placeholder value formaxValueorminValueif the true maximum or minimum value cannot be expressed as a long.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
equals
-
hashCode
public int hashCode() -
isInteger
public abstract boolean isInteger()Whether the data-type represents an integer or floating-point?- Returns:
- true if the data-type represents integers only, false if it is float-point.
-
isUnsigned
public abstract boolean isUnsigned()Whether the data-type is unsigned?- Returns:
- true if the data-type is unsigned, false if it is signed.
-
toString
-
numberBytes
public int numberBytes()The number of bytes needed to represent this data-type.- Returns:
- the number of bytes.
-
bitDepth
public int bitDepth()The number of bits required to represent a voxel. -
maxValue
public long maxValue()The maximum value this type can represent, orVALUE_NOT_COMPATIBLEif it cannot be represented in a long. -
minValue
public long minValue()The minimum value this type can represent, orVALUE_NOT_COMPATIBLEif it cannot be represented in a long.
-