Package gov.nih.mipav.model.file
Class FileBFLOAT
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileBFLOAT
-
-
Field Summary
Fields Modifier and Type Field Description private int
bufferSize
DOCUMENT ME!private boolean
endianess
DOCUMENT ME!private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoBFLOAT
fileInfo
DOCUMENT ME!private FileInfoBFLOAT
fileInfoCopy
private long
fileLength
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private boolean
foundEOF
DOCUMENT ME!private ModelImage
image
DOCUMENT ME!private float[]
imgBuffer
DOCUMENT ME!private int[]
imgExtents
DOCUMENT ME!private float[]
imgResols
DOCUMENT ME!private java.lang.String
originalFileName
DOCUMENT ME!private int
xDim
DOCUMENT ME!private int
yDim
DOCUMENT ME!private int
zDim
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 FileBFLOAT(java.lang.String originalFileName, java.lang.String fileDir)
Interfile reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.FileInfoBFLOAT
getFileInfo()
Returns the file info.float[]
getImageBuffer()
Returns the image buffer.private void
readBuffer(int slice, float[] buffer)
Reads a slice of data at a time and stores the results in the buffer.ModelImage
readImage(boolean one)
Reads the image.private java.lang.String
readLine()
Reads lines of the file and strips comments indicated by the ; symbol until a nonnull String results or the end of the file is reached.-
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
-
bufferSize
private int bufferSize
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 FileInfoBFLOAT fileInfo
DOCUMENT ME!
-
fileInfoCopy
private FileInfoBFLOAT fileInfoCopy
-
fileLength
private long fileLength
DOCUMENT ME!
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
foundEOF
private boolean foundEOF
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
imgBuffer
private float[] imgBuffer
DOCUMENT ME!
-
imgExtents
private int[] imgExtents
DOCUMENT ME!
-
imgResols
private float[] imgResols
DOCUMENT ME!
-
originalFileName
private java.lang.String originalFileName
DOCUMENT ME!
-
xDim
private int xDim
DOCUMENT ME!
-
yDim
private int yDim
DOCUMENT ME!
-
zDim
private int zDim
DOCUMENT ME!
-
-
Constructor Detail
-
FileBFLOAT
public FileBFLOAT(java.lang.String originalFileName, java.lang.String fileDir) throws java.io.IOException
Interfile reader/writer constructor.- Parameters:
originalFileName
- file namefileDir
- file directory- Throws:
java.io.IOException
- if there is an error making the file
-
-
Method Detail
-
getFileInfo
public FileInfoBFLOAT getFileInfo()
Returns the file info.- Returns:
- FileInfoBase containing the file info
-
getImageBuffer
public float[] getImageBuffer()
Returns the image buffer.- Returns:
- buffer of image.
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalize
method for existing elements, closes any open files and sets other elements tonull
.
-
readImage
public ModelImage readImage(boolean one) throws java.io.IOException
Reads the image.- Parameters:
one
- Flag for only reading one image of dataset.- Returns:
- returns the image
- 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
-
readLine
private java.lang.String readLine() throws java.io.IOException
Reads lines of the file and strips comments indicated by the ; symbol until a nonnull String results or the end of the file is reached.- Returns:
- the line read in
- Throws:
java.io.IOException
- if there is an error reading the file
-
-