Class FileCheshire


  • public class FileCheshire
    extends FileBase
    The class reads Cheshire file images.
    Version:
    0.1 Oct 14, 1997
    Author:
    Matthew J. McAuliffe, Ph.D.
    See Also:
    FileIO, FileInfoAnalyze, FileRaw
    • Field Detail

      • fileDir

        private java.lang.String fileDir
        DOCUMENT ME!
      • fileName

        private java.lang.String fileName
        DOCUMENT ME!
      • nBytesPerVoxel

        private long nBytesPerVoxel
        DOCUMENT ME!
      • scaleFactor

        private float[] scaleFactor
        DOCUMENT ME!
      • startFirstImage

        private long startFirstImage
        DOCUMENT ME!
      • startSecondImage

        private long startSecondImage
        DOCUMENT ME!
      • subLength

        private long subLength
        DOCUMENT ME!
      • xDim

        private int xDim
        DOCUMENT ME!
      • yDim

        private int yDim
        DOCUMENT ME!
      • zDim

        private int zDim
        DOCUMENT ME!
      • tDim

        private int tDim
        DOCUMENT ME!
      • xRes

        private float xRes
        DOCUMENT ME!
      • yRes

        private float yRes
        DOCUMENT ME!
      • zRes

        private float zRes
        DOCUMENT ME!
      • tRes

        private float tRes
        DOCUMENT ME!
    • Constructor Detail

      • FileCheshire

        public FileCheshire​(java.lang.String fName,
                            java.lang.String fDir,
                            boolean show)
        Creates a new FileCheshire object.
        Parameters:
        fName - file name
        fDir - file directory
        show - boolean for showing the progress bar
    • 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
      • isCheshire

        public static boolean isCheshire​(java.lang.String fName,
                                         java.lang.String fDir)
        Method to test to determine if the image format is Cheshire, so appropriate read method may be called.
        Parameters:
        fName - File name of image.
        fDir - Directory.
        Returns:
        true if Cheshire file, false otherwise.
      • getFileInfo

        public FileInfoCheshire getFileInfo()
        Returns the FileInfoCheshire read from the file.
        Returns:
        File info structure read from file, or null if file has not been read.
      • readHeader

        public boolean readHeader​(java.lang.String imageFileName,
                                  java.lang.String fileDir)
                           throws java.io.IOException
        Reads the header and stores the information in fileInfo.
        Parameters:
        imageFileName - File name of image.
        fileDir - Directory.
        Returns:
        Flag to confirm a successful read.
        Throws:
        java.io.IOException - if there is an error reading the header
        See Also:
        FileInfoAnalyze
      • readImage

        public ModelImage readImage()
                             throws java.io.IOException,
                                    java.lang.OutOfMemoryError
        Reads an Cheshire image file by reading the header then making a FileRaw to read the image for all filenames in the file list. Only the one file directory (currently) supported.
        Throws:
        java.io.IOException - if there is an error reading the file
        java.lang.OutOfMemoryError
        See Also:
        FileRaw