Package gov.nih.mipav.model.file
Class FileBFLOAT
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileBFLOAT
- Author:
- William Gandler
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intDOCUMENT ME!private booleanDOCUMENT ME!private FileDOCUMENT ME!private StringDOCUMENT ME!private FileInfoBFLOATDOCUMENT ME!private FileInfoBFLOATprivate longDOCUMENT ME!private StringDOCUMENT ME!private booleanDOCUMENT ME!private ModelImageDOCUMENT ME!private float[]DOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileBFLOAT(String originalFileName, String fileDir) Interfile reader/writer constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.Returns the file info.float[]Returns the image buffer.private voidreadBuffer(int slice, float[] buffer) Reads a slice of data at a time and stores the results in the buffer.readImage(boolean one) Reads the image.private StringreadLine()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 Details
-
bufferSize
private int bufferSizeDOCUMENT ME! -
endianess
private boolean endianessDOCUMENT ME! -
file
DOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileInfoCopy
-
fileLength
private long fileLengthDOCUMENT ME! -
fileName
DOCUMENT ME! -
foundEOF
private boolean foundEOFDOCUMENT ME! -
image
DOCUMENT ME! -
imgBuffer
private float[] imgBufferDOCUMENT ME! -
imgExtents
private int[] imgExtentsDOCUMENT ME! -
imgResols
private float[] imgResolsDOCUMENT ME! -
originalFileName
DOCUMENT ME! -
xDim
private int xDimDOCUMENT ME! -
yDim
private int yDimDOCUMENT ME! -
zDim
private int zDimDOCUMENT ME!
-
-
Constructor Details
-
FileBFLOAT
Interfile reader/writer constructor.- Parameters:
originalFileName- file namefileDir- file directory- Throws:
IOException- if there is an error making the file
-
-
Method Details
-
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 thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
readImage
Reads the image.- Parameters:
one- Flag for only reading one image of dataset.- Returns:
- returns the image
- Throws:
IOException- if there is an error reading the file
-
readBuffer
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:
IOException- if there is an error reading the file
-
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.- Returns:
- the line read in
- Throws:
IOException- if there is an error reading the file
-