Package gov.nih.mipav.model.file
Class FileCheshire
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileCheshire
The class reads Cheshire file images.
- Version:
- 0.1 Oct 14, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringDOCUMENT ME!private FileInfoCheshireDOCUMENT ME!private FileInfoCheshireprivate StringDOCUMENT ME!private ModelImageDOCUMENT ME!private longDOCUMENT ME!private float[]DOCUMENT ME!private longDOCUMENT ME!private longDOCUMENT ME!private longDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileCheshire(String fName, String fDir, boolean show) Creates a new FileCheshire object. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.Returns the FileInfoCheshire read from the file.static booleanisCheshire(String fName, String fDir) Method to test to determine if the image format is Cheshire, so appropriate read method may be called.booleanreadHeader(String imageFileName, String fileDir) Reads the header and stores the information in fileInfo.Reads an Cheshire image file by reading the header then making a FileRaw to read the image for all filenames in the file list.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
-
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileInfoCopy
-
fileName
DOCUMENT ME! -
image
DOCUMENT ME! -
nBytesPerVoxel
private long nBytesPerVoxelDOCUMENT ME! -
scaleFactor
private float[] scaleFactorDOCUMENT ME! -
startFirstImage
private long startFirstImageDOCUMENT ME! -
startSecondImage
private long startSecondImageDOCUMENT ME! -
subLength
private long subLengthDOCUMENT ME! -
xDim
private int xDimDOCUMENT ME! -
yDim
private int yDimDOCUMENT ME! -
zDim
private int zDimDOCUMENT ME! -
tDim
private int tDimDOCUMENT ME! -
xRes
private float xResDOCUMENT ME! -
yRes
private float yResDOCUMENT ME! -
zRes
private float zResDOCUMENT ME! -
tRes
private float tResDOCUMENT ME!
-
-
Constructor Details
-
FileCheshire
Creates a new FileCheshire object.- Parameters:
fName- file namefDir- file directoryshow- boolean for showing the progress bar
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
isCheshire
Method to test to determine if the image format is Cheshire, so appropriate read method may be called.- Parameters:
fName- File name of image.fDir- Directory.- Returns:
trueif Cheshire file,falseotherwise.
-
getFileInfo
Returns the FileInfoCheshire read from the file.- Returns:
- File info structure read from file, or null if file has not been read.
-
readHeader
Reads the header and stores the information in fileInfo.- Parameters:
imageFileName- File name of image.fileDir- Directory.- Returns:
- Flag to confirm a successful read.
- Throws:
IOException- if there is an error reading the header- See Also:
-
readImage
Reads an Cheshire image file by reading the header then making a FileRaw to read the image for all filenames in the file list. Only the one file directory (currently) supported.- Throws:
IOException- if there is an error reading the fileOutOfMemoryError- See Also:
-