Package gov.nih.mipav.model.file
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 Summary
Fields Modifier and Type Field Description private byte[]
bufferByte
Buffer used to store image of type byte.private byte[]
bufferByte2
Second buffer used to store image of type byte.private short[]
bufferShort
Buffer used to store image of type short or unsigned byte.private int
bufferSize
Size of buffer to be allocated.private byte[]
litArray
Temporary buffer.private byte[]
repArray
Temporary buffer.private int
type
Image 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 Constructor Description FilePackBit(java.io.RandomAccessFile file)
Packbitconstructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.byte[]
getByteBuffer()
Gets the byte buffer of the image data.short[]
getShortBuffer()
Gets the short buffer of the image.int
getStripSize(ModelImage image, int start, int end)
This method returns the packed bit strip size.void
setImageFile(java.io.RandomAccessFile file)
Sets the image file.void
writePackBitImage(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 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.
-
-
Method Detail
-
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
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!
-
-