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 long VALUE_NOT_COMPATIBLE
    A placeholder value for maxValue or minValue if 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
    int bitDepth()
    The number of bits required to represent a voxel.
    boolean equals​(Object obj)  
    int hashCode()  
    abstract boolean isInteger()
    Whether the data-type represents an integer or floating-point?
    abstract boolean isUnsigned()
    Whether the data-type is unsigned?
    long maxValue()
    The maximum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    long minValue()
    The minimum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    int numberBytes()
    The number of bytes needed to represent this data-type.
    String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • VALUE_NOT_COMPATIBLE

      public static final long VALUE_NOT_COMPATIBLE
      A placeholder value for maxValue or minValue if the true maximum or minimum value cannot be expressed as a long.
      See Also:
      Constant Field Values
  • Constructor Details

    • VoxelDataType

      public VoxelDataType​(int bitDepth, String typeIdentifier, long maxValue, long minValue)
  • Method Details

    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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

      public final String toString()
      Overrides:
      toString in class Object
    • 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, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    • minValue

      public long minValue()
      The minimum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.