Package gov.nih.mipav.model.file
Class FileLIFF
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileLIFF
-
public class FileLIFF extends FileBase
-
-
Field Summary
Fields Modifier and Type Field Description private static short
Clip
private static int
DEEP_GREY_10
private static int
DEEP_GREY_16
private static int
DEEP_GREY_9
private static short
DefHilite
private static short
DHDVText
private static short
DirectBitsRect
private static short
eraseRect
private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoLIFF
fileInfo
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private static short
FillPat
private static short
fontName
private static short
glyphState
private static short
HeaderOp
private ModelImage
image
DOCUMENT ME!private int[]
imageExtents
DOCUMENT ME!private float[]
imgBuffer
DOCUMENT ME!private float[]
imgResols
DOCUMENT ME!private static short
kAnnotationLayer
private static short
kBinaryLayer
private static short
kBlackChannelLayer
private static short
kBlueChannelLayer
private static short
kBrightFieldLayer
private static short
kCyanChannelLayer
private static short
kDarkFieldLayer
private static short
kDeepMaskLayer
private static short
kGeneralImageLayer
private static short
kGreenChannelLayer
private static short
kLuminosityLayer
private static short
kMagentaChannelLayer
private static short
kMaskLayer
private static short
kMasterImageLayer
private static short
kMovieLayer
private static short
kRedChannelLayer
private static short
kRGBChannelLayer
private static short
kUnitsOther
private static short
kYellowChannelLayer
private static short
lineJustify
private static short
LongComment
private ModelLUT
LUT
DOCUMENT ME!private static int
MAC_1_BIT
private static int
MAC_16_BIT_COLOR
private static int
MAC_16_COLORS
private static int
MAC_16_GREYS
private static int
MAC_24_BIT_COLOR
private static int
MAC_256_COLORS
private static int
MAC_256_GREYS
private static int
MAC_4_GREYS
private static short
NOP
private static short
OpEndPic
private static short
PackBitsRect
private static short
TxFont
private static short
TxSize
private static int
UNKNOWN
-
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 FileLIFF(java.lang.String fileName, java.lang.String fileDir)
LIFF reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for cleanup.FileInfoBase
getFileInfo()
Accessor that returns the file info.float[]
getImageBuffer()
Accessor that returns the image buffer.ModelLUT
getModelLUT()
Rreturns LUT if defined.private java.lang.String
readCString()
ModelImage
readImage(boolean multiFile, boolean one)
Reads the LIFF header which indicates endianess, the TIFF magic number, and the offset in bytes of the first IFD.void
setFileName(java.lang.String fName)
Accessor to set the file name (used for reading COR multiFile).-
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
-
kMasterImageLayer
private static final short kMasterImageLayer
- See Also:
- Constant Field Values
-
kGeneralImageLayer
private static final short kGeneralImageLayer
- See Also:
- Constant Field Values
-
kBinaryLayer
private static final short kBinaryLayer
- See Also:
- Constant Field Values
-
kRGBChannelLayer
private static final short kRGBChannelLayer
- See Also:
- Constant Field Values
-
kRedChannelLayer
private static final short kRedChannelLayer
- See Also:
- Constant Field Values
-
kGreenChannelLayer
private static final short kGreenChannelLayer
- See Also:
- Constant Field Values
-
kBlueChannelLayer
private static final short kBlueChannelLayer
- See Also:
- Constant Field Values
-
kCyanChannelLayer
private static final short kCyanChannelLayer
- See Also:
- Constant Field Values
-
kMagentaChannelLayer
private static final short kMagentaChannelLayer
- See Also:
- Constant Field Values
-
kYellowChannelLayer
private static final short kYellowChannelLayer
- See Also:
- Constant Field Values
-
kBlackChannelLayer
private static final short kBlackChannelLayer
- See Also:
- Constant Field Values
-
kLuminosityLayer
private static final short kLuminosityLayer
- See Also:
- Constant Field Values
-
kMaskLayer
private static final short kMaskLayer
- See Also:
- Constant Field Values
-
kDeepMaskLayer
private static final short kDeepMaskLayer
- See Also:
- Constant Field Values
-
kAnnotationLayer
private static final short kAnnotationLayer
- See Also:
- Constant Field Values
-
kMovieLayer
private static final short kMovieLayer
- See Also:
- Constant Field Values
-
kDarkFieldLayer
private static final short kDarkFieldLayer
- See Also:
- Constant Field Values
-
kBrightFieldLayer
private static final short kBrightFieldLayer
- See Also:
- Constant Field Values
-
UNKNOWN
private static final int UNKNOWN
- See Also:
- Constant Field Values
-
MAC_1_BIT
private static final int MAC_1_BIT
- See Also:
- Constant Field Values
-
MAC_4_GREYS
private static final int MAC_4_GREYS
- See Also:
- Constant Field Values
-
MAC_16_GREYS
private static final int MAC_16_GREYS
- See Also:
- Constant Field Values
-
MAC_16_COLORS
private static final int MAC_16_COLORS
- See Also:
- Constant Field Values
-
MAC_256_GREYS
private static final int MAC_256_GREYS
- See Also:
- Constant Field Values
-
MAC_256_COLORS
private static final int MAC_256_COLORS
- See Also:
- Constant Field Values
-
MAC_16_BIT_COLOR
private static final int MAC_16_BIT_COLOR
- See Also:
- Constant Field Values
-
MAC_24_BIT_COLOR
private static final int MAC_24_BIT_COLOR
- See Also:
- Constant Field Values
-
DEEP_GREY_9
private static final int DEEP_GREY_9
- See Also:
- Constant Field Values
-
DEEP_GREY_10
private static final int DEEP_GREY_10
- See Also:
- Constant Field Values
-
DEEP_GREY_16
private static final int DEEP_GREY_16
- See Also:
- Constant Field Values
-
kUnitsOther
private static final short kUnitsOther
- See Also:
- Constant Field Values
-
NOP
private static final short NOP
- See Also:
- Constant Field Values
-
Clip
private static final short Clip
- See Also:
- Constant Field Values
-
TxFont
private static final short TxFont
- See Also:
- Constant Field Values
-
FillPat
private static final short FillPat
- See Also:
- Constant Field Values
-
TxSize
private static final short TxSize
- See Also:
- Constant Field Values
-
DefHilite
private static final short DefHilite
- See Also:
- Constant Field Values
-
DHDVText
private static final short DHDVText
- See Also:
- Constant Field Values
-
fontName
private static final short fontName
- See Also:
- Constant Field Values
-
lineJustify
private static final short lineJustify
- See Also:
- Constant Field Values
-
glyphState
private static final short glyphState
- See Also:
- Constant Field Values
-
eraseRect
private static final short eraseRect
- See Also:
- Constant Field Values
-
PackBitsRect
private static final short PackBitsRect
- See Also:
- Constant Field Values
-
DirectBitsRect
private static final short DirectBitsRect
- See Also:
- Constant Field Values
-
LongComment
private static final short LongComment
- See Also:
- Constant Field Values
-
OpEndPic
private static final short OpEndPic
- See Also:
- Constant Field Values
-
HeaderOp
private static final short HeaderOp
- See Also:
- Constant Field Values
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoLIFF fileInfo
DOCUMENT ME!
-
fileName
private java.lang.String fileName
DOCUMENT ME!
-
image
private ModelImage image
DOCUMENT ME!
-
imageExtents
private int[] imageExtents
DOCUMENT ME!
-
imgBuffer
private float[] imgBuffer
DOCUMENT ME!
-
imgResols
private float[] imgResols
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
.
-
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 presentfalse
if one file with either a 2D image or a stack of 2D imagesone
-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.
-
-