Package gov.nih.mipav.model.file
Class FileLIFF
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileLIFF
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final shortprivate static final intprivate static final intprivate static final intprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate FileDOCUMENT ME!private StringDOCUMENT ME!private FileInfoLIFFDOCUMENT ME!private StringDOCUMENT ME!private static final shortprivate static final shortprivate static final shortprivate static final shortprivate ModelImageDOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate ModelLUTDOCUMENT ME!private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final intFields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for cleanup.Accessor that returns the file info.float[]Accessor that returns the image buffer.Rreturns LUT if defined.private StringreadImage(boolean multiFile, boolean one) Reads the LIFF header which indicates endianess, the TIFF magic number, and the offset in bytes of the first IFD.voidsetFileName(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 Details
-
kMasterImageLayer
private static final short kMasterImageLayer- See Also:
-
kGeneralImageLayer
private static final short kGeneralImageLayer- See Also:
-
kBinaryLayer
private static final short kBinaryLayer- See Also:
-
kRGBChannelLayer
private static final short kRGBChannelLayer- See Also:
-
kRedChannelLayer
private static final short kRedChannelLayer- See Also:
-
kGreenChannelLayer
private static final short kGreenChannelLayer- See Also:
-
kBlueChannelLayer
private static final short kBlueChannelLayer- See Also:
-
kCyanChannelLayer
private static final short kCyanChannelLayer- See Also:
-
kMagentaChannelLayer
private static final short kMagentaChannelLayer- See Also:
-
kYellowChannelLayer
private static final short kYellowChannelLayer- See Also:
-
kBlackChannelLayer
private static final short kBlackChannelLayer- See Also:
-
kLuminosityLayer
private static final short kLuminosityLayer- See Also:
-
kMaskLayer
private static final short kMaskLayer- See Also:
-
kDeepMaskLayer
private static final short kDeepMaskLayer- See Also:
-
kAnnotationLayer
private static final short kAnnotationLayer- See Also:
-
kMovieLayer
private static final short kMovieLayer- See Also:
-
kDarkFieldLayer
private static final short kDarkFieldLayer- See Also:
-
kBrightFieldLayer
private static final short kBrightFieldLayer- See Also:
-
UNKNOWN
private static final int UNKNOWN- See Also:
-
MAC_1_BIT
private static final int MAC_1_BIT- See Also:
-
MAC_4_GREYS
private static final int MAC_4_GREYS- See Also:
-
MAC_16_GREYS
private static final int MAC_16_GREYS- See Also:
-
MAC_16_COLORS
private static final int MAC_16_COLORS- See Also:
-
MAC_256_GREYS
private static final int MAC_256_GREYS- See Also:
-
MAC_256_COLORS
private static final int MAC_256_COLORS- See Also:
-
MAC_16_BIT_COLOR
private static final int MAC_16_BIT_COLOR- See Also:
-
MAC_24_BIT_COLOR
private static final int MAC_24_BIT_COLOR- See Also:
-
DEEP_GREY_9
private static final int DEEP_GREY_9- See Also:
-
DEEP_GREY_10
private static final int DEEP_GREY_10- See Also:
-
DEEP_GREY_16
private static final int DEEP_GREY_16- See Also:
-
kUnitsOther
private static final short kUnitsOther- See Also:
-
NOP
private static final short NOP- See Also:
-
Clip
private static final short Clip- See Also:
-
TxFont
private static final short TxFont- See Also:
-
FillPat
private static final short FillPat- See Also:
-
TxSize
private static final short TxSize- See Also:
-
DefHilite
private static final short DefHilite- See Also:
-
DHDVText
private static final short DHDVText- See Also:
-
fontName
private static final short fontName- See Also:
-
lineJustify
private static final short lineJustify- See Also:
-
glyphState
private static final short glyphState- See Also:
-
eraseRect
private static final short eraseRect- See Also:
-
PackBitsRect
private static final short PackBitsRect- See Also:
-
DirectBitsRect
private static final short DirectBitsRect- See Also:
-
LongComment
private static final short LongComment- See Also:
-
OpEndPic
private static final short OpEndPic- See Also:
-
HeaderOp
private static final short HeaderOp- See Also:
-
file
DOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileName
DOCUMENT ME! -
image
DOCUMENT ME! -
imageExtents
private int[] imageExtentsDOCUMENT ME! -
imgBuffer
private float[] imgBufferDOCUMENT ME! -
imgResols
private float[] imgResolsDOCUMENT ME! -
LUT
DOCUMENT ME!
-
-
Constructor Details
-
FileLIFF
LIFF reader/writer constructor.- Parameters:
fileName- file namefileDir- file directory- Throws:
IOException- if there is an error making the file
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
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
Rreturns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
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-trueif a set of files each containing a separate 2D image is presentfalseif one file with either a 2D image or a stack of 2D imagesone-trueif only want to read in one image of the 3D set- Returns:
- returns the image
- Throws:
IOException- if there is an error reading the file
-
readCString
- Throws:
IOException
-
setFileName
Accessor to set the file name (used for reading COR multiFile).- Parameters:
fName- file name of image to read.
-