Package gov.nih.mipav.model.algorithms
Class AlgorithmASM.FileMATLAB
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.algorithms.AlgorithmASM.FileMATLAB
-
- Enclosing class:
- AlgorithmASM
public class AlgorithmASM.FileMATLAB extends FileBase
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoMATLAB
fileInfo
DOCUMENT ME!private FileInfoMATLAB
fileInfo2
private java.lang.String
fileName
DOCUMENT ME!private ModelImage
image
DOCUMENT ME!private ModelImage
image2
private int[]
imageExtents
DOCUMENT ME!private float[]
imgBuffer
DOCUMENT ME!private float[]
imgResols
DOCUMENT ME!private ModelLUT
LUT
DOCUMENT ME!private FileInfoMATLAB
maskFileInfo
private FileInfoMATLAB
maskFileInfo2
private ModelImage
maskImage
private ModelImage
maskImage2
private static int
miCOMPRESSED
Compressed Dataprivate static int
miDOUBLE
IEEE 754 double formatprivate static int
miINT16
16-bit, signedprivate static int
miINT32
32-bit signedprivate static int
miINT64
64-bit, signedprivate static int
miINT8
8 bit, signedprivate static int
miMATRIX
MATLAB ARRAYprivate static int
miSINGLE
IEEE 754 single formatprivate static int
miUINT16
16-bit, unsignedprivate static int
miUINT32
32-bit, unsignedprivate static int
miUINT64
64-bit, unsignedprivate static int
miUINT8
8 bit, unsignedprivate static int
miUTF16
Unicode UTF-16 Encoded Character Dataprivate static int
miUTF32
Unicode UTF-32 Encoded Character Dataprivate static int
miUTF8
Unicode UTF-8 Encoded Character Dataprivate static byte
mxCELL_CLASS
Cell arrayprivate static byte
mxCHAR_CLASS
Character arrayprivate static byte
mxDOUBLE_CLASS
Double precision arrayprivate static byte
mxINT16_CLASS
16-bit, signed integerprivate static byte
mxINT32_CLASS
32-bit, signed integerprivate static byte
mxINT64_CLASS
64-bit, signed integerprivate static byte
mxINT8_CLASS
8-bit, signed integerprivate static byte
mxOBJECT_CLASS
Objectprivate static byte
mxSINGLE_CLASS
Single precision arrayprivate static byte
mxSPARSE_CLASS
Sparse arrayprivate static byte
mxSTRUCT_CLASS
Structureprivate static byte
mxUINT16_CLASS
16-bit, unsigned integerprivate static byte
mxUINT32_CLASS
32-bit, unsigned integerprivate static byte
mxUINT64_CLASS
64-bit, unsigned integerprivate static byte
mxUINT8_CLASS
8-bit, unsigned integerprivate ViewJFrameImage
vFrame2
private ViewJFrameImage
vmFrame
private ViewJFrameImage
vmFrame2
private java.util.zip.Inflater
zlibDecompresser
-
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 FileMATLAB(java.lang.String fileName, java.lang.String fileDir)
LIFF reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.FileInfoBase
getFileInfo()
Accessor that returns the file info.float[]
getImageBuffer()
Accessor that returns the image buffer.ModelLUT
getModelLUT()
Rreturns LUT if defined.private java.lang.String
readCString()
ModelImage
readImage(boolean multiFile, boolean one)
Reads the MATLAB header.void
setFileName(java.lang.String fName)
Accessor to set the file name (used for reading COR multiFile).-
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
-
miINT8
private static final int miINT8
8 bit, signed- See Also:
- Constant Field Values
-
miUINT8
private static final int miUINT8
8 bit, unsigned- See Also:
- Constant Field Values
-
miINT16
private static final int miINT16
16-bit, signed- See Also:
- Constant Field Values
-
miUINT16
private static final int miUINT16
16-bit, unsigned- See Also:
- Constant Field Values
-
miINT32
private static final int miINT32
32-bit signed- See Also:
- Constant Field Values
-
miUINT32
private static final int miUINT32
32-bit, unsigned- See Also:
- Constant Field Values
-
miSINGLE
private static final int miSINGLE
IEEE 754 single format- See Also:
- Constant Field Values
-
miDOUBLE
private static final int miDOUBLE
IEEE 754 double format- See Also:
- Constant Field Values
-
miINT64
private static final int miINT64
64-bit, signed- See Also:
- Constant Field Values
-
miUINT64
private static final int miUINT64
64-bit, unsigned- See Also:
- Constant Field Values
-
miMATRIX
private static final int miMATRIX
MATLAB ARRAY- See Also:
- Constant Field Values
-
miCOMPRESSED
private static final int miCOMPRESSED
Compressed Data- See Also:
- Constant Field Values
-
miUTF8
private static final int miUTF8
Unicode UTF-8 Encoded Character Data- See Also:
- Constant Field Values
-
miUTF16
private static final int miUTF16
Unicode UTF-16 Encoded Character Data- See Also:
- Constant Field Values
-
miUTF32
private static final int miUTF32
Unicode UTF-32 Encoded Character Data- See Also:
- Constant Field Values
-
mxCELL_CLASS
private static final byte mxCELL_CLASS
Cell array- See Also:
- Constant Field Values
-
mxSTRUCT_CLASS
private static final byte mxSTRUCT_CLASS
Structure- See Also:
- Constant Field Values
-
mxOBJECT_CLASS
private static final byte mxOBJECT_CLASS
Object- See Also:
- Constant Field Values
-
mxCHAR_CLASS
private static final byte mxCHAR_CLASS
Character array- See Also:
- Constant Field Values
-
mxSPARSE_CLASS
private static final byte mxSPARSE_CLASS
Sparse array- See Also:
- Constant Field Values
-
mxDOUBLE_CLASS
private static final byte mxDOUBLE_CLASS
Double precision array- See Also:
- Constant Field Values
-
mxSINGLE_CLASS
private static final byte mxSINGLE_CLASS
Single precision array- See Also:
- Constant Field Values
-
mxINT8_CLASS
private static final byte mxINT8_CLASS
8-bit, signed integer- See Also:
- Constant Field Values
-
mxUINT8_CLASS
private static final byte mxUINT8_CLASS
8-bit, unsigned integer- See Also:
- Constant Field Values
-
mxINT16_CLASS
private static final byte mxINT16_CLASS
16-bit, signed integer- See Also:
- Constant Field Values
-
mxUINT16_CLASS
private static final byte mxUINT16_CLASS
16-bit, unsigned integer- See Also:
- Constant Field Values
-
mxINT32_CLASS
private static final byte mxINT32_CLASS
32-bit, signed integer- See Also:
- Constant Field Values
-
mxUINT32_CLASS
private static final byte mxUINT32_CLASS
32-bit, unsigned integer- See Also:
- Constant Field Values
-
mxINT64_CLASS
private static final byte mxINT64_CLASS
64-bit, signed integer- See Also:
- Constant Field Values
-
mxUINT64_CLASS
private static final byte mxUINT64_CLASS
64-bit, unsigned integer- See Also:
- Constant Field Values
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoMATLAB fileInfo
DOCUMENT ME!
-
fileInfo2
private FileInfoMATLAB fileInfo2
-
maskFileInfo
private FileInfoMATLAB maskFileInfo
-
maskFileInfo2
private FileInfoMATLAB maskFileInfo2
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
imageExtents
private int[] imageExtents
DOCUMENT ME!
-
imgBuffer
private float[] imgBuffer
DOCUMENT ME!
-
imgResols
private float[] imgResols
DOCUMENT ME!
-
LUT
private ModelLUT LUT
DOCUMENT ME!
-
zlibDecompresser
private java.util.zip.Inflater zlibDecompresser
-
image2
private ModelImage image2
-
vFrame2
private ViewJFrameImage vFrame2
-
maskImage
private ModelImage maskImage
-
vmFrame
private ViewJFrameImage vmFrame
-
maskImage2
private ModelImage maskImage2
-
vmFrame2
private ViewJFrameImage vmFrame2
-
-
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 FileInfoBase getFileInfo()
Accessor that returns the file info.- Returns:
- FileInfoBase containing the file info
-
getImageBuffer
public float[] getImageBuffer()
Accessor that returns the image buffer.- Returns:
- buffer of image.
-
getModelLUT
public ModelLUT getModelLUT()
Rreturns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
public ModelImage readImage(boolean multiFile, boolean one) throws java.io.IOException
Reads the MATLAB header.- Parameters:
multiFile
-true
if a set of files each containing a separate 2D image is presentfalse
if one file with either a 2D image or a stack of 2D imagesone
-true
if only want to read in one image of the 3D set- Returns:
- returns the image
- Throws:
java.io.IOException
- if there is an error reading the file
-
readCString
private java.lang.String readCString() throws java.io.IOException
- Throws:
java.io.IOException
-
setFileName
public void setFileName(java.lang.String fName)
Accessor to set the file name (used for reading COR multiFile).- Parameters:
fName
- file name of image to read.
-
-