Package gov.nih.mipav.model.file
Class FileGESigna5X
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileGESigna5X
-
public class FileGESigna5X extends FileBase
Reads both GE Neducak Systems MR 5X and LX. Modify to handle MRGE files from a GE signa-5 with IMGF starting at locating 3228 and image data starting at location 8424. Follows file format thru lenUsrDefData field; then varies from format.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
byteBuffer
DOCUMENT ME!private int
compression
DOCUMENT ME!private int
depth
private java.lang.String
fileDir
DOCUMENT ME!private java.io.File
fileHeader
DOCUMENT ME!private FileInfoGESigna5X
fileInfo
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private int
height
DOCUMENT ME!private int
imageNumber
DOCUMENT ME!private int
imagePtr
DOCUMENT ME!private int
lenExamHdr
DOCUMENT ME!private int
lenImageHdr
DOCUMENT ME!private int
lenSeriesHdr
DOCUMENT ME!private int[]
orient
DOCUMENT ME!private float[]
start
DOCUMENT ME!private int
startAdjust
DOCUMENT ME!private int
width
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 FileGESigna5X(java.lang.String fileName, java.lang.String fileDir)
reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
checkMagicNumber()
DOCUMENT ME!void
finalize()
Prepares this class for cleanup.FileInfoGESigna5X
getFileInfo()
DOCUMENT ME!int
getHeight()
DOCUMENT ME!int
getImageNumber()
DOCUMENT ME!int
getStartAdjust()
DOCUMENT ME!int
getWidth()
DOCUMENT ME!boolean
isGESigna5X()
Looks for the magic number "IMGF" in image header for GE Signa 5.X type file.private void
readBuffer(float[] buffer)
Reads a slice of data at a time and stores the results in the buffer.void
readImage(float[] buffer)
reads the Signa 5X file header and data.int
readImageFileData()
DOCUMENT ME!void
setFileName(java.lang.String fName)
Accessor that sets the file name and allocates new FileInfo, File and RandomAccess file objects.void
writeImage(ModelImage image, FileWriteOptions options)
-
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
-
byteBuffer
private byte[] byteBuffer
DOCUMENT ME!
-
compression
private int compression
DOCUMENT ME!
-
depth
private int depth
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileHeader
private java.io.File fileHeader
DOCUMENT ME!
-
fileInfo
private FileInfoGESigna5X fileInfo
DOCUMENT ME!
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
imageNumber
private int imageNumber
DOCUMENT ME!
-
imagePtr
private int imagePtr
DOCUMENT ME!
-
lenExamHdr
private int lenExamHdr
DOCUMENT ME!
-
lenImageHdr
private int lenImageHdr
DOCUMENT ME!
-
lenSeriesHdr
private int lenSeriesHdr
DOCUMENT ME!
-
orient
private int[] orient
DOCUMENT ME!
-
start
private float[] start
DOCUMENT ME!
-
startAdjust
private int startAdjust
DOCUMENT ME!
-
width
private int width
DOCUMENT ME!
-
height
private int height
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
.
-
getFileInfo
public FileInfoGESigna5X getFileInfo()
DOCUMENT ME!- Returns:
- FileInfoGESigna5X fileInfo
-
getHeight
public int getHeight()
DOCUMENT ME!- Returns:
- int height
-
getImageNumber
public int getImageNumber()
DOCUMENT ME!- Returns:
- int image number
-
getStartAdjust
public int getStartAdjust()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getWidth
public int getWidth()
DOCUMENT ME!- Returns:
- int width
-
readImage
public void readImage(float[] buffer) throws java.io.IOException
reads the Signa 5X file header and data.- Parameters:
buffer
- DOCUMENT ME!- Throws:
java.io.IOException
- if there is an error reading the file
-
readImageFileData
public int readImageFileData()
DOCUMENT ME!- Returns:
- int size of image file data
-
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.
-
isGESigna5X
public boolean isGESigna5X() throws java.io.IOException
Looks for the magic number "IMGF" in image header for GE Signa 5.X type file. If present, the image is GE SIGNA 5.X format.- Returns:
- boolean true if the magic number was found in the image header.
- Throws:
java.io.IOException
- Indicates error reading the file
-
checkMagicNumber
private boolean checkMagicNumber()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
readBuffer
private void readBuffer(float[] 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 info is stored- Throws:
java.io.IOException
- DOCUMENT ME!
-
writeImage
public void writeImage(ModelImage image, FileWriteOptions options) throws java.io.IOException
- Throws:
java.io.IOException
-
-