Package gov.nih.mipav.model.file
Class FileJSON
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileJSON
-
public class FileJSON extends FileBase
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
endianess
DOCUMENT ME!private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoJSON
fileInfo
DOCUMENT ME!private FileInfoJSON
fileInfoCopy
private java.lang.String
fileName
DOCUMENT ME!private ModelImage[]
image
DOCUMENT ME!private ModelLUT[]
LUT
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE
-
-
Constructor Summary
Constructors Constructor Description FileJSON(java.lang.String fileName, java.lang.String fileDir)
JSON reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.ModelLUT[]
getModelLUTArray()
returns LUT if defined.ModelImage[]
readImage()
reads the JSON file header and data.private java.lang.String
readLine()
readLine() - reads a line of the file and strips comments indicated by the # symbol.-
Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
-
-
-
Field Detail
-
endianess
private boolean endianess
DOCUMENT ME!
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoJSON fileInfo
DOCUMENT ME!
-
fileInfoCopy
private FileInfoJSON fileInfoCopy
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
image
private ModelImage[] image
DOCUMENT ME!
-
LUT
private ModelLUT[] LUT
DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for cleanup. Calls thefinalize
method for existing elements, closes any open files and sets other elements tonull
.
-
getModelLUTArray
public ModelLUT[] getModelLUTArray()
returns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
public ModelImage[] readImage() throws java.io.IOException
reads the JSON file header and data.- Returns:
- DOCUMENT ME!
- Throws:
java.io.IOException
- if there is an error reading the file
-
readLine
private java.lang.String readLine() throws java.io.IOException
readLine() - reads a line of the file and strips comments indicated by the # symbol.- Returns:
- the line read in
- Throws:
java.io.IOException
- if there is an error reading the file
-
-