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.StringfileDirDOCUMENT ME!private java.io.FilefileHeaderDOCUMENT ME!private FileInfoMagnetomVisionfileInfoDOCUMENT ME!private java.lang.StringfileNameDOCUMENT ME!private int[]imgExtentsDOCUMENT ME!private float[]imgResolsDOCUMENT ME!private int[]orientDOCUMENT 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 voidclose()Closes random access file.voidfinalize()Prepares this class for cleanup.FileInfoMagnetomVisiongetFileInfo()Get the file info generated by reading in the magnetom vision file.ModelLUTgetModelLUT()Returns null.booleanisMagnetomVision()Looks for the string "MAGNETOM VISION" in image header ID.FileInfoMagnetomVisionreadHeader()Reads the Magnetom file header and data.voidreadImage(short[] buffer)Reads a slice of data at a time and stores the results in the buffer.voidsetFileName(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.IOExceptionMagnetom 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 thefinalizemethod for existing elements, closes any open files and sets other elements tonull.
-
close
public void close() throws java.io.IOExceptionCloses 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.IOExceptionLooks 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.IOExceptionReads 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.IOExceptionAccessor 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.
-
-