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.String
fileDir
DOCUMENT ME!private FileInfoCheshire
fileInfo
DOCUMENT ME!private FileInfoCheshire
fileInfoCopy
private java.lang.String
fileName
DOCUMENT ME!private ModelImage
image
DOCUMENT ME!private long
nBytesPerVoxel
DOCUMENT ME!private float[]
scaleFactor
DOCUMENT ME!private long
startFirstImage
DOCUMENT ME!private long
startSecondImage
DOCUMENT ME!private long
subLength
DOCUMENT ME!private int
tDim
DOCUMENT ME!private float
tRes
DOCUMENT ME!private int
xDim
DOCUMENT ME!private float
xRes
DOCUMENT ME!private int
yDim
DOCUMENT ME!private float
yRes
DOCUMENT ME!private int
zDim
DOCUMENT ME!private float
zRes
DOCUMENT 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 void
finalize()
Prepares this class for cleanup.FileInfoCheshire
getFileInfo()
Returns the FileInfoCheshire read from the file.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.boolean
readHeader(java.lang.String imageFileName, java.lang.String fileDir)
Reads the header and stores the information in fileInfo.ModelImage
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.-
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 thefinalize
method 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:
true
if Cheshire file,false
otherwise.
-
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.IOException
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:
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
-
-