Package gov.nih.mipav.model.file
Class FileGESigna5X
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileGESigna5X
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
FieldsModifier and TypeFieldDescriptionprivate byte[]DOCUMENT ME!private intDOCUMENT ME!private intprivate StringDOCUMENT ME!private FileDOCUMENT ME!private FileInfoGESigna5XDOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT 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 -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanDOCUMENT ME!voidfinalize()Prepares this class for cleanup.DOCUMENT ME!intDOCUMENT ME!intDOCUMENT ME!intDOCUMENT ME!intgetWidth()DOCUMENT ME!booleanLooks for the magic number "IMGF" in image header for GE Signa 5.X type file.private voidreadBuffer(float[] buffer) Reads a slice of data at a time and stores the results in the buffer.voidreadImage(float[] buffer) reads the Signa 5X file header and data.intDOCUMENT ME!voidsetFileName(String fName) Accessor that sets the file name and allocates new FileInfo, File and RandomAccess file objects.voidwriteImage(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 Details
-
byteBuffer
private byte[] byteBufferDOCUMENT ME! -
compression
private int compressionDOCUMENT ME! -
depth
private int depth -
fileDir
DOCUMENT ME! -
fileHeader
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileName
DOCUMENT ME! -
imageNumber
private int imageNumberDOCUMENT ME! -
imagePtr
private int imagePtrDOCUMENT ME! -
lenExamHdr
private int lenExamHdrDOCUMENT ME! -
lenImageHdr
private int lenImageHdrDOCUMENT ME! -
lenSeriesHdr
private int lenSeriesHdrDOCUMENT ME! -
orient
private int[] orientDOCUMENT ME! -
start
private float[] startDOCUMENT ME! -
startAdjust
private int startAdjustDOCUMENT ME! -
width
private int widthDOCUMENT ME! -
height
private int heightDOCUMENT ME!
-
-
Constructor Details
-
FileGESigna5X
reader/writer constructor.- Parameters:
fileName- file namefileDir- file directory- Throws:
IOException- if there is an error making the file
-
-
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. -
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
reads the Signa 5X file header and data.- Parameters:
buffer- DOCUMENT ME!- Throws:
IOException- if there is an error reading the file
-
readImageFileData
public int readImageFileData()DOCUMENT ME!- Returns:
- int size of image file data
-
setFileName
Accessor that sets the file name and allocates new FileInfo, File and RandomAccess file objects.- Parameters:
fName- File name.- Throws:
IOException- if there is an error constructing the files.
-
isGESigna5X
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:
IOException- Indicates error reading the file
-
checkMagicNumber
private boolean checkMagicNumber()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
readBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
buffer- buffer where the info is stored- Throws:
IOException- DOCUMENT ME!
-
writeImage
- Throws:
IOException
-