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 shortClipprivate static intDEEP_GREY_10private static intDEEP_GREY_16private static intDEEP_GREY_9private static shortDefHiliteprivate static shortDHDVTextprivate static shortDirectBitsRectprivate static shorteraseRectprivate java.io.FilefileDOCUMENT ME!private java.lang.StringfileDirDOCUMENT ME!private FileInfoLIFFfileInfoDOCUMENT ME!private java.lang.StringfileNameDOCUMENT ME!private static shortFillPatprivate static shortfontNameprivate static shortglyphStateprivate static shortHeaderOpprivate ModelImageimageDOCUMENT ME!private int[]imageExtentsDOCUMENT ME!private float[]imgBufferDOCUMENT ME!private float[]imgResolsDOCUMENT ME!private static shortkAnnotationLayerprivate static shortkBinaryLayerprivate static shortkBlackChannelLayerprivate static shortkBlueChannelLayerprivate static shortkBrightFieldLayerprivate static shortkCyanChannelLayerprivate static shortkDarkFieldLayerprivate static shortkDeepMaskLayerprivate static shortkGeneralImageLayerprivate static shortkGreenChannelLayerprivate static shortkLuminosityLayerprivate static shortkMagentaChannelLayerprivate static shortkMaskLayerprivate static shortkMasterImageLayerprivate static shortkMovieLayerprivate static shortkRedChannelLayerprivate static shortkRGBChannelLayerprivate static shortkUnitsOtherprivate static shortkYellowChannelLayerprivate static shortlineJustifyprivate static shortLongCommentprivate ModelLUTLUTDOCUMENT ME!private static intMAC_1_BITprivate static intMAC_16_BIT_COLORprivate static intMAC_16_COLORSprivate static intMAC_16_GREYSprivate static intMAC_24_BIT_COLORprivate static intMAC_256_COLORSprivate static intMAC_256_GREYSprivate static intMAC_4_GREYSprivate static shortNOPprivate static shortOpEndPicprivate static shortPackBitsRectprivate static shortTxFontprivate static shortTxSizeprivate static intUNKNOWN-
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 voidfinalize()Prepares this class for cleanup.FileInfoBasegetFileInfo()Accessor that returns the file info.float[]getImageBuffer()Accessor that returns the image buffer.ModelLUTgetModelLUT()Rreturns LUT if defined.private java.lang.StringreadCString()ModelImagereadImage(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(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 thefinalizemethod 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-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:
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.
-
-