Class FilePackBit


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

      • 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 Detail

      • FilePackBit

        public FilePackBit​(java.io.RandomAccessFile file)
        Packbitconstructor.
        Parameters:
        file - random access file pointer
    • Method Detail

      • 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 java.io.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:
        java.io.IOException - DOCUMENT ME!
      • setImageFile

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

        public void writePackBitImage​(ModelImage image,
                                      int start,
                                      int end)
                               throws java.io.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:
        java.io.IOException - DOCUMENT ME!