Package gov.nih.mipav.model.file
Class FilePackBit
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FilePackBit
The class reads and writes packed bit files for tiff formatted images (including STK).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]Buffer used to store image of type byte.private byte[]Second buffer used to store image of type byte.private short[]Buffer used to store image of type short or unsigned byte.private intSize of buffer to be allocated.private byte[]Temporary buffer.private byte[]Temporary buffer.private intImage type ID.Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.byte[]Gets the byte buffer of the image data.short[]Gets the short buffer of the image.intgetStripSize(ModelImage image, int start, int end) This method returns the packed bit strip size.voidsetImageFile(RandomAccessFile file) Sets the image file.voidwritePackBitImage(ModelImage image, int start, int end) This method writes a packed bit image file (1D-5D).Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
Field Details
-
bufferByte
private byte[] bufferByteBuffer used to store image of type byte. -
bufferByte2
private byte[] bufferByte2Second buffer used to store image of type byte. -
bufferShort
private short[] bufferShortBuffer used to store image of type short or unsigned byte. -
bufferSize
private int bufferSizeSize of buffer to be allocated. -
litArray
private byte[] litArrayTemporary buffer. -
repArray
private byte[] repArrayTemporary buffer. -
type
private int typeImage type ID.
-
-
Constructor Details
-
FilePackBit
Packbitconstructor.- Parameters:
file- random access file pointer
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. -
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
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
Sets the image file.- Parameters:
file- random access file pointer
-
writePackBitImage
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!
-