Package gov.nih.mipav.model.file
Class FileMagnetomVision
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileMagnetomVision
-
public class FileMagnetomVision extends FileBase
Class that reads Siemens Magnetom Vision files.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
fileDir
DOCUMENT ME!private java.io.File
fileHeader
DOCUMENT ME!private FileInfoMagnetomVision
fileInfo
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private int[]
imgExtents
DOCUMENT ME!private float[]
imgResols
DOCUMENT ME!private int[]
orient
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 FileMagnetomVision(java.lang.String fileName, java.lang.String fileDir)
Magnetom Vision reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes random access file.void
finalize()
Prepares this class for cleanup.FileInfoMagnetomVision
getFileInfo()
Get the file info generated by reading in the magnetom vision file.ModelLUT
getModelLUT()
Returns null.boolean
isMagnetomVision()
Looks for the string "MAGNETOM VISION" in image header ID.FileInfoMagnetomVision
readHeader()
Reads the Magnetom file header and data.void
readImage(short[] buffer)
Reads a slice of data at a time and stores the results in the buffer.void
setFileName(java.lang.String fName)
Accessor that sets the file name and allocates new FileInfo, File and RandomAccess file objects.-
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!
-
fileHeader
private java.io.File fileHeader
DOCUMENT ME!
-
fileInfo
private FileInfoMagnetomVision fileInfo
DOCUMENT ME!
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
imgExtents
private int[] imgExtents
DOCUMENT ME!
-
imgResols
private float[] imgResols
DOCUMENT ME!
-
orient
private int[] orient
DOCUMENT ME!
-
-
Constructor Detail
-
FileMagnetomVision
public FileMagnetomVision(java.lang.String fileName, java.lang.String fileDir) throws java.io.IOException
Magnetom Vision reader/writer constructor.- Parameters:
fileName
- file namefileDir
- file directory- Throws:
java.io.IOException
- if there is an error making the file
-
-
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
.
-
close
public void close() throws java.io.IOException
Closes random access file.- Throws:
java.io.IOException
- DOCUMENT ME!
-
getFileInfo
public FileInfoMagnetomVision getFileInfo()
Get the file info generated by reading in the magnetom vision file.- Returns:
- The file info.
-
getModelLUT
public ModelLUT getModelLUT()
Returns null.- Returns:
- null.
-
isMagnetomVision
public boolean isMagnetomVision() throws java.io.IOException
Looks for the string "MAGNETOM VISION" in image header ID. If present, the image is a Siemens Magnetom Vision format.- Returns:
- boolean true if the string "MAGNETOM VISION" was found in the image header.
- Throws:
java.io.IOException
- Indicates error reading the file
-
readHeader
public FileInfoMagnetomVision readHeader() throws java.io.IOException
Reads the Magnetom file header and data.- Returns:
- Returns an object containing the file info.
- Throws:
java.io.IOException
- if there is an error reading the file
-
readImage
public void readImage(short[] buffer) throws java.io.IOException
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
buffer
- Buffer where the image is stored- Throws:
java.io.IOException
- if there is an error reading the file
-
setFileName
public void setFileName(java.lang.String fName) throws java.io.IOException
Accessor that sets the file name and allocates new FileInfo, File and RandomAccess file objects.- Parameters:
fName
- File name.- Throws:
java.io.IOException
- if there is an error constructing the files.
-
-