Class FileMATLAB


  • public class FileMATLAB
    extends FileBase
    • Field Detail

      • 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
      • 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!
      • fileName

        private java.lang.String fileName
        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
      • filePointer

        private long filePointer
      • maximumNonZeroElements

        private int maximumNonZeroElements
      • haveNumericArrayCharacter

        private boolean haveNumericArrayCharacter
      • numberCharacterClasses

        private int numberCharacterClasses
      • haveImported

        private boolean haveImported
    • Constructor Detail

      • FileMATLAB

        public FileMATLAB​(java.lang.String fileName,
                          java.lang.String fileDir)
                   throws java.io.IOException
        LIFF reader/writer constructor.
        Parameters:
        fileName - file name
        fileDir - 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 the finalize method for existing elements, closes any open files and sets other elements to null.
        Overrides:
        finalize in class FileBase
      • 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 present false if one file with either a 2D image or a stack of 2D images
        one - 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.
      • writeImage

        public void writeImage​(ModelImage image,
                               FileWriteOptions options)
                        throws java.io.IOException
        Writes a MATLAB format type image.
        Parameters:
        image - Image model of data to write.
        options - options such as starting and ending slices and times
        Throws:
        java.io.IOException - if there is an error writing the file