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 intbufferSizeDOCUMENT ME!private booleanendianessDOCUMENT ME!private java.io.FilefileDOCUMENT ME!private java.lang.StringfileDirDOCUMENT ME!private FileInfoBFLOATfileInfoDOCUMENT ME!private FileInfoBFLOATfileInfoCopyprivate longfileLengthDOCUMENT ME!private java.lang.StringfileNameDOCUMENT ME!private booleanfoundEOFDOCUMENT ME!private ModelImageimageDOCUMENT ME!private float[]imgBufferDOCUMENT ME!private int[]imgExtentsDOCUMENT ME!private float[]imgResolsDOCUMENT ME!private java.lang.StringoriginalFileNameDOCUMENT ME!private intxDimDOCUMENT ME!private intyDimDOCUMENT ME!private intzDimDOCUMENT 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 voidfinalize()Prepares this class for cleanup.FileInfoBFLOATgetFileInfo()Returns the file info.float[]getImageBuffer()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.ModelImagereadImage(boolean one)Reads the image.private java.lang.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 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.IOExceptionInterfile 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 thefinalizemethod 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.IOExceptionReads 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.IOExceptionReads 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
-
-