Package gov.nih.mipav.model.file
Class FileTMG
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileTMG
-
public class FileTMG extends FileBase
DOCUMENT ME!
-
-
Field Summary
Fields Modifier and Type Field Description private int
dataType
DOCUMENT ME!private boolean
endianess
DOCUMENT ME!private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoTMG
fileInfo
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private ModelImage
image
DOCUMENT ME!private int[]
imgExtents
DOCUMENT ME!private ModelLUT
LUT
DOCUMENT ME!private int
rangeX
DOCUMENT ME!private int
rangeY
DOCUMENT ME!private byte[]
sBuffer
DOCUMENT ME!-
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 FileTMG(java.lang.String fileName, java.lang.String fileDir)
TMG reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.ModelLUT
getModelLUT()
returns LUT if defined.private void
readBuffer(int slice, float[] buffer)
Reads a slice of data at a time and stores the results in the buffer.ModelImage
readImage()
reads the TMG file header and data.private java.lang.String
readStr()
DOCUMENT ME!-
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
-
dataType
private int dataType
DOCUMENT ME!
-
endianess
private boolean endianess
DOCUMENT ME!
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoTMG fileInfo
DOCUMENT ME!
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
imgExtents
private int[] imgExtents
DOCUMENT ME!
-
LUT
private ModelLUT LUT
DOCUMENT ME!
-
rangeX
private int rangeX
DOCUMENT ME!
-
rangeY
private int rangeY
DOCUMENT ME!
-
sBuffer
private byte[] sBuffer
DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalize
method for existing elements, closes any open files and sets other elements tonull
.
-
getModelLUT
public ModelLUT getModelLUT()
returns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
public ModelImage readImage() throws java.io.IOException
reads the TMG file header and data.- Returns:
- DOCUMENT ME!
- Throws:
java.io.IOException
- if there is an error reading the file
-
readBuffer
private void readBuffer(int slice, float[] buffer) throws java.io.IOException
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice
- offset into the file stored in the dataOffset arraybuffer
- buffer where the info is stored- Throws:
java.io.IOException
- if there is an error reading the file
-
readStr
private java.lang.String readStr() throws java.io.IOException
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
java.io.IOException
- DOCUMENT ME!
-
-