Package gov.nih.mipav.model.file
Class FileOME
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileOME
-
public class FileOME extends FileBase
DOCUMENT ME!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
FileOME.MyXMLHandler
Private class used by the parser to parse the XML file.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
fileDir
The directory where the xml header and raw image data file are located.private FileInfoOME
fileInfo
The info for the image file.private java.lang.String
fileName
The name of the xml image header file.private ModelImage
image
The image to read or write.private java.lang.String
imageFileName
The name of the raw image data file.private ModelLUT
LUT
The image's lut.private boolean
showProgress
Whether to show a progress bar while processing the file.private boolean
usesLUT
Whether the image has a lut already.private static java.lang.String
W3C_XML_SCHEMA
The W3C XML schema.-
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 FileOME(java.lang.String fName, java.lang.String fDir, boolean show)
Constructs new file object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
readHeader(java.lang.String headerFileName, java.lang.String headerFileDir)
Read the image XML header.ModelImage
readImage()
Reads an XML image file by reading the XML header then making a FileRaw to read the image for all filenames in the file list.-
Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, finalize, 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
-
W3C_XML_SCHEMA
private static final java.lang.String W3C_XML_SCHEMA
The W3C XML schema.- See Also:
- Constant Field Values
-
fileDir
private java.lang.String fileDir
The directory where the xml header and raw image data file are located.
-
fileInfo
private FileInfoOME fileInfo
The info for the image file.
-
fileName
private java.lang.String fileName
The name of the xml image header file.
-
image
private ModelImage image
The image to read or write.
-
imageFileName
private java.lang.String imageFileName
The name of the raw image data file.
-
LUT
private ModelLUT LUT
The image's lut.
-
showProgress
private boolean showProgress
Whether to show a progress bar while processing the file.
-
usesLUT
private boolean usesLUT
Whether the image has a lut already. One is generated if this variable is false.
-
-
Method Detail
-
readHeader
public boolean readHeader(java.lang.String headerFileName, java.lang.String headerFileDir) throws java.io.IOException
Read the image XML header.- Parameters:
headerFileName
- the header file nameheaderFileDir
- the directory the header file is in- Returns:
- true if successful, false otherwise
- Throws:
java.io.IOException
- if there is an error reading the header file from disk
-
readImage
public ModelImage readImage() throws java.io.IOException, java.lang.OutOfMemoryError
Reads an XML image file by reading the XML header then making a FileRaw to read the image for all filenames in the file list. Only the one file directory (currently) supported.- Returns:
- The image.
- Throws:
java.io.IOException
- if there is an error reading the filejava.lang.OutOfMemoryError
- if there is not enough memory available to read in the image- See Also:
FileRaw
-
-