Package gov.nih.mipav.model.file
Class FileSpar
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileSpar
Reads a spar/sdat file. MIPAV only uses the spar information since the sdat is spectroscopy data.
- Author:
- senseneyj
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringFile directory of the image.private FileInfoSPARReference fileinfoprivate StringFile name of the image.static final String[]The extensions of ANALYZE file.private ModelImageThe image read in from the file.private ModelImageprivate FileInfoBaseimageA file infostatic final String[]private FileInfoSPARfile infoFields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileSpar(ModelImage imageA, FileInfoBase imageAInfo, String fileName, String fileDir) -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]getCompleteFileNameList(String absolutePath) Returns the complete list of file names according to given file name.static StringgetHeaderFile(String[] fileNames) ======= Returns the header file.static booleanisHeaderFile(String absolutePath) Return true if the file specified by absolutePath is header file of ANALYZE.static booleanisImageFile(String absolutePath) Return true if the file specified by absolutePath is image file of ANALYZE.private static doubleparseDouble(String nextLine) private static intbooleanreadHeader(String imageFileName, String fileDir) Reads the spar header and stores the information in fileInfo.readImage(boolean one) Constructs a SPAR image mask based on the parameters defined in FileInfoSPARprivate intsetLowerExtents(int index) private intsetUpperExtents(int index) private ModelImageupdateTransformMatrix(ModelImage image) Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, finalize, 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
-
hdrEXTENSIONS
The extensions of ANALYZE file. -
imgEXTENSIONS
-
fileDir
File directory of the image. -
fileName
File name of the image. -
image
The image read in from the file. -
outInfo
file info -
imageAInfo
imageA file info -
imageA
-
fileInfo
Reference fileinfo
-
-
Constructor Details
-
FileSpar
-
FileSpar
-
-
Method Details
-
parseDouble
-
parseInt
-
readHeader
Reads the spar header and stores the information in fileInfo.- Parameters:
imageFileName- File name of image (is also the spar file).fileDir- Directory.- Returns:
- Flag to confirm a successful read.
- Throws:
IOException- if there is an error reading the header- See Also:
-
setLowerExtents
private int setLowerExtents(int index) -
setUpperExtents
private int setUpperExtents(int index) -
readImage
Constructs a SPAR image mask based on the parameters defined in FileInfoSPAR- Parameters:
one- flag indicating one image of a 3D dataset should be read in.- Returns:
- The image.
- Throws:
IOException- if there is an error reading the fileOutOfMemoryError- See Also:
-
getFileInfo
-
updateTransformMatrix
-
getCompleteFileNameList
Returns the complete list of file names according to given file name.- Parameters:
absolutePath- one file name of PARREC.- Returns:
- the complete list of file names.
-
getHeaderFile
======= Returns the header file.- Parameters:
fileNames- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
isHeaderFile
Return true if the file specified by absolutePath is header file of ANALYZE.- Parameters:
absolutePath- the file name including path information.- Returns:
- true if the specified file is header file.
-
isImageFile
Return true if the file specified by absolutePath is image file of ANALYZE.- Parameters:
absolutePath- the file name including path information.- Returns:
- true if the specified file is image file.
-