Package gov.nih.mipav.model.file
Class FileMedVision
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileMedVision
The class reads MedVision files that have been saved as MAC bin files. The MAC files have needed image resolutions
encoded in the in the resource section at the end of the file. MedVision also has method of saving images to the
Intel world but pixel resolutions are not stored. Here I decode MAC MedVision files. It is easy to write a Intel
MedVision reader or one could directly read in the file using using MIPA because they have a fixed offset and can be
read in using the RAW file reader.
- Version:
- 0.1 June 25, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortDOCUMENT ME!static final shortDOCUMENT ME!private FileDOCUMENT ME!private StringDOCUMENT ME!private FileInfoMedVisionDOCUMENT ME!private FileInfoMedVisionDOCUMENT ME!private StringDOCUMENT ME!private ModelImageDOCUMENT ME!private ViewJProgressBarDOCUMENT ME!private float[]DOCUMENT ME!static final shortDOCUMENT ME!static final shortDOCUMENT ME!static final shortDOCUMENT ME!private double[]DOCUMENT ME!private double[][]DOCUMENT ME!static final shortDOCUMENT ME!static final shortDOCUMENT ME!static final shortDOCUMENT ME!Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileMedVision(String fName, String fDir) FileMedVision - MedVision reader/writer constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcopyFileInfoCommon - copy common file info into new header Better must exist but this works.private booleandecodeFileHeader(boolean endianess) readFileHeader - reader image file header that encodes info about image.private voiddecodeResourceFooter(boolean endianess) decodeResourceFooter - This is the tricky function that decodes the the resource footer at the end of the MAC file The data is coded is very odd manner.private booleandecodeSliceHeader(long start, FileInfoMedVision fileInfo, boolean endianess) decodeSliceHeader - reads image slice header that encodes info about specific image slice.private doublegetMedVisionDouble(boolean endianess) getMedVisionDouble - extracts double value from MedVision MAC resource fork.readImage - reads a MedVision file in MAC format (i.e., decodes resource info).Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, finalize, 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
-
BIT8
public static final short BIT8DOCUMENT ME!- See Also:
-
BIT16
public static final short BIT16DOCUMENT ME!- See Also:
-
SIGNED
public static final short SIGNEDDOCUMENT ME!- See Also:
-
UNSIGNED
public static final short UNSIGNEDDOCUMENT ME!- See Also:
-
S8BIT
public static final short S8BITDOCUMENT ME!- See Also:
-
U8BIT
public static final short U8BITDOCUMENT ME!- See Also:
-
S16BIT
public static final short S16BITDOCUMENT ME!- See Also:
-
U16BIT
public static final short U16BITDOCUMENT ME!- See Also:
-
file
DOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileInfoCom
DOCUMENT ME! -
fileName
DOCUMENT ME! -
image
DOCUMENT ME! -
progressBar
DOCUMENT ME! -
resolutions
private float[] resolutionsDOCUMENT ME! -
slicePosition
private double[] slicePositionDOCUMENT ME! -
sliceResolutions
private double[][] sliceResolutionsDOCUMENT ME!
-
-
Constructor Details
-
FileMedVision
FileMedVision - MedVision reader/writer constructor.- Parameters:
fName- file namefDir- file directory
-
-
Method Details
-
readImage
readImage - reads a MedVision file in MAC format (i.e., decodes resource info).- Returns:
- image model of the data read in from the file
- Throws:
IOException- if there is an error reading the file- See Also:
-
copyFileInfoCommon
private void copyFileInfoCommon()copyFileInfoCommon - copy common file info into new header Better must exist but this works. -
decodeFileHeader
readFileHeader - reader image file header that encodes info about image.- Parameters:
endianess- boolean describing byte order- Returns:
- boolean indicating successful read
- Throws:
IOException- if there is an error reading the file- See Also:
-
decodeSliceHeader
private boolean decodeSliceHeader(long start, FileInfoMedVision fileInfo, boolean endianess) throws IOException decodeSliceHeader - reads image slice header that encodes info about specific image slice.- Parameters:
start- start of file informationfileInfo- file informationendianess- boolean describing byte order- Returns:
- boolean indicating successful decoding
- Throws:
IOException- if there is an error reading the file
-
getMedVisionDouble
getMedVisionDouble - extracts double value from MedVision MAC resource fork.- Parameters:
endianess- describes byte ordering of data- Returns:
- returns extracted double
- Throws:
IOException- if there is an error reading the file
-