Class FileMATLAB

java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileMATLAB

public class FileMATLAB extends FileBase
  • Field Details

    • miINT8

      private static final int miINT8
      8 bit, signed
      See Also:
    • miUINT8

      private static final int miUINT8
      8 bit, unsigned
      See Also:
    • miINT16

      private static final int miINT16
      16-bit, signed
      See Also:
    • miUINT16

      private static final int miUINT16
      16-bit, unsigned
      See Also:
    • miINT32

      private static final int miINT32
      32-bit signed
      See Also:
    • miUINT32

      private static final int miUINT32
      32-bit, unsigned
      See Also:
    • miSINGLE

      private static final int miSINGLE
      IEEE 754 single format
      See Also:
    • miDOUBLE

      private static final int miDOUBLE
      IEEE 754 double format
      See Also:
    • miINT64

      private static final int miINT64
      64-bit, signed
      See Also:
    • miUINT64

      private static final int miUINT64
      64-bit, unsigned
      See Also:
    • miMATRIX

      private static final int miMATRIX
      MATLAB ARRAY
      See Also:
    • miCOMPRESSED

      private static final int miCOMPRESSED
      Compressed Data
      See Also:
    • miUTF8

      private static final int miUTF8
      Unicode UTF-8 Encoded Character Data
      See Also:
    • miUTF16

      private static final int miUTF16
      Unicode UTF-16 Encoded Character Data
      See Also:
    • miUTF32

      private static final int miUTF32
      Unicode UTF-32 Encoded Character Data
      See Also:
    • mxCELL_CLASS

      private static final byte mxCELL_CLASS
      Cell array
      See Also:
    • mxSTRUCT_CLASS

      private static final byte mxSTRUCT_CLASS
      Structure
      See Also:
    • mxOBJECT_CLASS

      private static final byte mxOBJECT_CLASS
      Object
      See Also:
    • mxCHAR_CLASS

      private static final byte mxCHAR_CLASS
      Character array
      See Also:
    • mxSPARSE_CLASS

      private static final byte mxSPARSE_CLASS
      Sparse array
      See Also:
    • mxDOUBLE_CLASS

      private static final byte mxDOUBLE_CLASS
      Double precision array
      See Also:
    • mxSINGLE_CLASS

      private static final byte mxSINGLE_CLASS
      Single precision array
      See Also:
    • mxINT8_CLASS

      private static final byte mxINT8_CLASS
      8-bit, signed integer
      See Also:
    • mxUINT8_CLASS

      private static final byte mxUINT8_CLASS
      8-bit, unsigned integer
      See Also:
    • mxINT16_CLASS

      private static final byte mxINT16_CLASS
      16-bit, signed integer
      See Also:
    • mxUINT16_CLASS

      private static final byte mxUINT16_CLASS
      16-bit, unsigned integer
      See Also:
    • mxINT32_CLASS

      private static final byte mxINT32_CLASS
      32-bit, signed integer
      See Also:
    • mxUINT32_CLASS

      private static final byte mxUINT32_CLASS
      32-bit, unsigned integer
      See Also:
    • mxINT64_CLASS

      private static final byte mxINT64_CLASS
      64-bit, signed integer
      See Also:
    • mxUINT64_CLASS

      private static final byte mxUINT64_CLASS
      64-bit, unsigned integer
      See Also:
    • file

      private File file
      DOCUMENT ME!
    • fileDir

      private String fileDir
      DOCUMENT ME!
    • fileInfo

      private FileInfoMATLAB fileInfo
      DOCUMENT ME!
    • fileInfo2

      private FileInfoMATLAB fileInfo2
    • maskFileInfo

      private FileInfoMATLAB maskFileInfo
    • maskFileInfo2

      private FileInfoMATLAB maskFileInfo2
    • fileName

      private 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 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
    • filePointer

      private long filePointer
    • maximumNonZeroElements

      private int maximumNonZeroElements
    • haveNumericArrayCharacter

      private boolean haveNumericArrayCharacter
    • numberCharacterClasses

      private int numberCharacterClasses
    • haveImported

      private boolean haveImported
    • f

    • v

    • extentsf

      int[] extentsf
    • extentsv

      int[] extentsv
    • readf

      boolean readf
    • readv

      boolean readv
  • Constructor Details

    • FileMATLAB

      public FileMATLAB(String fileName, String fileDir) throws IOException
      LIFF reader/writer constructor.
      Parameters:
      fileName - file name
      fileDir - file directory
      Throws:
      IOException - if there is an error making the file
  • Method Details

    • 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
    • setfv

      public void setfv(Vector<Integer> f, Vector<Double> v, int[] extentsf, int[] extentsv)
    • readImage

      public ModelImage readImage(boolean multiFile, boolean one) throws 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:
      IOException - if there is an error reading the file
    • readCString

      private String readCString() throws IOException
      Throws:
      IOException
    • setFileName

      public void setFileName(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 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:
      IOException - if there is an error writing the file