Package gov.nih.mipav.model.file
Class FileSiemensText
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileSiemensText
- Version:
- 0.1 May 27, 2009
- Author:
- Andrew Morse
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortSiemensText file format define use to indicate 2-byte float - Intel style.static final shortSiemensText file format define use to indicate 2-byte integer - Intel style.static final shortSiemensText file format define use to indicate 2-byte integer - Sun style.static final shortSiemensText file format define use to indicate 4-byte float - Sun style.static final shortSiemensText file format define use to indicate 4-byte integer - Intel style.static final shortSiemensText file format define use to indicate 4-byte integer - Sun style.static final shortSiemensText file format define use to indicate Byte (8-bits) data typestatic final shortSiemensText file format define use to indicate undefined image data type.static final String[]The extensions of SiemensText file.private StringFile directory of the image.private FileReference to the header file (*.hdr).private FileInfoSiemensTextReference to the file info. for an SiemensText headerprivate StringFile name of the image.private ModelImageThe image read in from the file.Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.static String[]getCompleteFileNameList(String absolutePath) Returns the complete list of file names according to given file name.Returns the FileInfoSiemensText read from the file.Returns the header file.static StringgetHeaderFile(String[] fileNames) Returns the header file (ends in .hdr) as a string.String[]Returns the image file list.static String[]getImageFiles(String[] fileNames) Returns the image file list.static booleanisHeaderFile(String absolutePath) Return true if the file specified by absolutePath is header file of SiemensText.static booleanisImageFile(String absolutePath) Return true if the file specified by absolutePath is image file of SiemensText.static booleanisSiemensText(String absolutePath) booleanreadHeader(String imageFileName, String fileDir) Reads the SiemensText header and stores the information in fileInfo.readImage(boolean one) Reads an SiemensText image file by reading the header then making a FileRaw to read the image for all filenames in the file list.voidreadImage(float[] buffer) Reads an SiemensText image file by reading the header then making a FileRaw to read the file.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
-
EXTENSIONS
The extensions of SiemensText file. -
DT_UNKNOWN
public static final short DT_UNKNOWNSiemensText file format define use to indicate undefined image data type.- See Also:
-
DT_BYTE
public static final short DT_BYTESiemensText file format define use to indicate Byte (8-bits) data type- See Also:
-
DT_2INTEGERI
public static final short DT_2INTEGERISiemensText file format define use to indicate 2-byte integer - Intel style.- See Also:
-
DT_4INTEGERI
public static final short DT_4INTEGERISiemensText file format define use to indicate 4-byte integer - Intel style.- See Also:
-
DT_2FLOAT
public static final short DT_2FLOATSiemensText file format define use to indicate 2-byte float - Intel style.- See Also:
-
DT_4FLOAT
public static final short DT_4FLOATSiemensText file format define use to indicate 4-byte float - Sun style.- See Also:
-
DT_2INTEGERS
public static final short DT_2INTEGERSSiemensText file format define use to indicate 2-byte integer - Sun style.- See Also:
-
DT_4INTEGERS
public static final short DT_4INTEGERSSiemensText file format define use to indicate 4-byte integer - Sun style.- See Also:
-
storage
-
fileDir
File directory of the image. -
fileHeader
Reference to the header file (*.hdr). -
fileName
File name of the image. -
fileInfo
Reference to the file info. for an SiemensText header -
image
The image read in from the file.
-
-
Constructor Details
-
FileSiemensText
Constructs new file object.- Parameters:
fName- File name.fDir- File directory.
-
-
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. -
getCompleteFileNameList
Returns the complete list of file names according to given file name.- Parameters:
absolutePath- one file name of SiemensText.- Returns:
- the complete list of file names.
-
getHeaderFile
Returns the header file (ends in .hdr) as a string.- Parameters:
fileNames- DOCUMENT ME!- Returns:
- The header file (ends in .hdr)
-
getImageFiles
Returns the image file list.- Parameters:
fileNames- DOCUMENT ME!- Returns:
- the image file list.
-
isHeaderFile
Return true if the file specified by absolutePath is header file of SiemensText.- 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 SiemensText.- Parameters:
absolutePath- the file name including path information.- Returns:
- true if the specified file is image file.
-
isSiemensText
-
getFileInfo
Returns the FileInfoSiemensText read from the file.- Returns:
- File info read from file, or null if it has not been read.
-
getHeaderFile
Returns the header file.- Returns:
- DOCUMENT ME!
-
getImageFiles
Returns the image file list.- Returns:
- the image file list.
-
readHeader
Reads the SiemensText 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 SiemensText 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.- 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:
-
readImage
Reads an SiemensText image file by reading the header then making a FileRaw to read the file. Image data is left in buffer. If the fileInfo cannot be found, the header will be located and read first. Image is not 'flipped', and neither units of measure nor orientation are set.- Parameters:
buffer- Image buffer to store image data into.- Throws:
IOException- if there is an error reading the fileOutOfMemoryError- See Also:
-