Class FilePackBit

java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FilePackBit

public class FilePackBit extends FileBase
The class reads and writes packed bit files for tiff formatted images (including STK).
  • Field Details

    • bufferByte

      private byte[] bufferByte
      Buffer used to store image of type byte.
    • bufferByte2

      private byte[] bufferByte2
      Second buffer used to store image of type byte.
    • bufferShort

      private short[] bufferShort
      Buffer used to store image of type short or unsigned byte.
    • bufferSize

      private int bufferSize
      Size of buffer to be allocated.
    • litArray

      private byte[] litArray
      Temporary buffer.
    • repArray

      private byte[] repArray
      Temporary buffer.
    • type

      private int type
      Image type ID.
  • Constructor Details

    • FilePackBit

      public FilePackBit(RandomAccessFile file)
      Packbitconstructor.
      Parameters:
      file - random access file pointer
  • Method Details

    • finalize

      public void finalize()
      Prepares this class for cleanup.
      Overrides:
      finalize in class FileBase
    • getByteBuffer

      public byte[] getByteBuffer()
      Gets the byte buffer of the image data.
      Returns:
      the buffer
    • getShortBuffer

      public short[] getShortBuffer()
      Gets the short buffer of the image.
      Returns:
      the buffer
    • getStripSize

      public int getStripSize(ModelImage image, int start, int end) throws IOException
      This method returns the packed bit strip size.
      Parameters:
      image - image model from which the data will be read.
      start - start of data in the read image file in units of extents[0]*extents[1]
      end - end of data in the read image file in units of extents[0]*extents[1] Note that bufferSize is also in units of extents[0]*extents[1] This method only applies to BYTE or UBYTE data.
      Returns:
      DOCUMENT ME!
      Throws:
      IOException - DOCUMENT ME!
    • setImageFile

      public void setImageFile(RandomAccessFile file)
      Sets the image file.
      Parameters:
      file - random access file pointer
    • writePackBitImage

      public void writePackBitImage(ModelImage image, int start, int end) throws IOException
      This method writes a packed bit image file (1D-5D).
      Parameters:
      image - image model from which the data will be read.
      start - start of data in the read image file in units of extents[0]*extents[1]
      end - end of data in the read image file in units of extents[0]*extents[1] Note that bufferSize is also in units of extents[0]*extents[1] This method only applies to BYTE or UBYTE data.
      Throws:
      IOException - DOCUMENT ME!