Class FileJSON

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

public class FileJSON extends FileBase
  • Field Details

    • endianess

      private boolean endianess
      DOCUMENT ME!
    • file

      private File file
      DOCUMENT ME!
    • fileDir

      private String fileDir
      DOCUMENT ME!
    • fileInfo

      private FileInfoJSON fileInfo
      DOCUMENT ME!
    • fileInfoCopy

      private FileInfoJSON fileInfoCopy
    • fileName

      private String fileName
      DOCUMENT ME!
    • image

      private ModelImage[] image
      DOCUMENT ME!
    • LUT

      private ModelLUT[] LUT
      DOCUMENT ME!
  • Constructor Details

    • FileJSON

      public FileJSON(String fileName, String fileDir) throws IOException
      JSON 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
    • getModelLUTArray

      public ModelLUT[] getModelLUTArray()
      returns LUT if defined.
      Returns:
      the LUT if defined else it is null
    • readImage

      public ModelImage[] readImage() throws IOException
      reads the JSON file header and data.
      Returns:
      DOCUMENT ME!
      Throws:
      IOException - if there is an error reading the file
    • readLine

      private String readLine() throws IOException
      readLine() - reads a line of the file and strips comments indicated by the # symbol.
      Returns:
      the line read in
      Throws:
      IOException - if there is an error reading the file