Package gov.nih.mipav.model.file
Class FileCheshire
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileCheshire
-
public class FileCheshire extends FileBase
The class reads Cheshire file images.- Version:
- 0.1 Oct 14, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
FileIO,FileInfoAnalyze,FileRaw
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringfileDirDOCUMENT ME!private FileInfoCheshirefileInfoDOCUMENT ME!private FileInfoCheshirefileInfoCopyprivate java.lang.StringfileNameDOCUMENT ME!private ModelImageimageDOCUMENT ME!private longnBytesPerVoxelDOCUMENT ME!private float[]scaleFactorDOCUMENT ME!private longstartFirstImageDOCUMENT ME!private longstartSecondImageDOCUMENT ME!private longsubLengthDOCUMENT ME!private inttDimDOCUMENT ME!private floattResDOCUMENT ME!private intxDimDOCUMENT ME!private floatxResDOCUMENT ME!private intyDimDOCUMENT ME!private floatyResDOCUMENT ME!private intzDimDOCUMENT ME!private floatzResDOCUMENT 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 FileCheshire(java.lang.String fName, java.lang.String fDir, boolean show)Creates a new FileCheshire object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()Prepares this class for cleanup.FileInfoCheshiregetFileInfo()Returns the FileInfoCheshire read from the file.static booleanisCheshire(java.lang.String fName, java.lang.String fDir)Method to test to determine if the image format is Cheshire, so appropriate read method may be called.booleanreadHeader(java.lang.String imageFileName, java.lang.String fileDir)Reads the header and stores the information in fileInfo.ModelImagereadImage()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 Detail
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoCheshire fileInfo
DOCUMENT ME!
-
fileInfoCopy
private FileInfoCheshire fileInfoCopy
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
nBytesPerVoxel
private long nBytesPerVoxel
DOCUMENT ME!
-
scaleFactor
private float[] scaleFactor
DOCUMENT ME!
-
startFirstImage
private long startFirstImage
DOCUMENT ME!
-
startSecondImage
private long startSecondImage
DOCUMENT ME!
-
subLength
private long subLength
DOCUMENT ME!
-
xDim
private int xDim
DOCUMENT ME!
-
yDim
private int yDim
DOCUMENT ME!
-
zDim
private int zDim
DOCUMENT ME!
-
tDim
private int tDim
DOCUMENT ME!
-
xRes
private float xRes
DOCUMENT ME!
-
yRes
private float yRes
DOCUMENT ME!
-
zRes
private float zRes
DOCUMENT ME!
-
tRes
private float tRes
DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull.
-
isCheshire
public static boolean isCheshire(java.lang.String fName, java.lang.String fDir)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
public FileInfoCheshire getFileInfo()
Returns the FileInfoCheshire read from the file.- Returns:
- File info structure read from file, or null if file has not been read.
-
readHeader
public boolean readHeader(java.lang.String imageFileName, java.lang.String fileDir) throws java.io.IOExceptionReads the header and stores the information in fileInfo.- Parameters:
imageFileName- File name of image.fileDir- Directory.- Returns:
- Flag to confirm a successful read.
- Throws:
java.io.IOException- if there is an error reading the header- See Also:
FileInfoAnalyze
-
readImage
public ModelImage readImage() throws java.io.IOException, java.lang.OutOfMemoryError
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:
java.io.IOException- if there is an error reading the filejava.lang.OutOfMemoryError- See Also:
FileRaw
-
-