Class FileLIFF


  • public class FileLIFF
    extends FileBase
    • Constructor Detail

      • FileLIFF

        public FileLIFF​(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 LIFF header which indicates endianess, the TIFF magic number, and the offset in bytes of the first IFD. It then reads all the IFDs. This method then opens a Model of an image and imports the the images one slice at a time. Image slices are separated by an IFD.
        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.