Package gov.nih.mipav.model.file
Class FileJP2
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileJP2
- All Implemented Interfaces:
ActionListener,EventListener
Jpeg2K reader/ writer for 3D images.
- Version:
- 0.1, Mar 2007
- Author:
- Dzung Nguyen, Nam Nguyen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JDialogThe height of imageprivate JRadioButtonprivate JRadioButtonprivate JRadioButtonprivate JRadioButtonprivate JCheckBoxprivate JRadioButtonprivate JRadioButtonprivate JButtonprivate JButtonprivate JTextFieldprivate JTextFieldprivate JRadioButtonprivate JRadioButtonprivate JTextFieldprivate JCheckBoxprivate JTextFieldprivate booleanDOCUMENT ME!private DecimalFormatprivate StringFile directory.private FileInfoJP2File Info.private StringFile name.private ModelImageModel Image.private int[]DOCUMENT ME!(package private) intprivate JRadioButtonprivate JRadioButton(package private) intprivate ViewJProgressBarprivate JCheckBoxFields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFileJP2()Tiff reader/writer constructor.FileJP2(String fileName, String fileDir, ViewJProgressBar progressBar) Tiff reader/writer constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidint[]decodeImageData(byte[] imageData, int imageType) voidfinalize()Prepares this class for cleanup.Accessor that returns the file info.int[]Accessor that returns the image buffer.readImage(boolean multiFile, boolean one) Reads the JP2 header which indicates the number of slices and each slice's size.voidsetFileDir(String fDir) Accessor to set the file dir (used when reading TIFF multiFile).voidsetFileName(String fName) Accessor to set the file name (used when reading TIFF multiFile).private voidThis function is not used.voidwriteImage(ModelImage image, FileWriteOptions options) 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
-
endianess
private boolean endianessDOCUMENT ME! -
fileDir
File directory. -
fileInfo
File Info. -
image
Model Image. -
fileName
File name. -
intBuffer
private int[] intBufferDOCUMENT ME! -
advDecOptDialog
The height of image -
decRateField
-
decOkBut
-
decDefBut
-
decCancelBut
-
showDecInf
-
decResChkBox
-
csIgnoreBox
-
decParsOn
-
decParsOff
-
codeStrInfoOn
-
codeStrInfoOff
-
cerOn
-
cerOff
-
cverberOn
-
cverberOff
-
noRoiOn
-
noRoiOff
-
decResTf
-
f
-
nStartFrameDec
int nStartFrameDec -
nEndFrameDec
int nEndFrameDec -
decFrameStart
-
decFrameEnd
-
progressBar
-
-
Constructor Details
-
FileJP2
Tiff reader/writer constructor.- Parameters:
fileName- file namefileDir- file directory- Throws:
IOException- if there is an error making the file
-
FileJP2
Tiff 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 int[] getImageBuffer()Accessor that returns the image buffer.- Returns:
- buffer of image.
-
decodeImageData
public int[] decodeImageData(byte[] imageData, int imageType) -
readImage
Reads the JP2 header which indicates the number of slices and each slice's size. It then reads all the encoded slice. 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
-
setFileDir
Accessor to set the file dir (used when reading TIFF multiFile).- Parameters:
fDir- file dir of image to read.
-
setFileName
Accessor to set the file name (used when reading TIFF multiFile).- Parameters:
fName- file name of image to read.
-
writeImage
- Throws:
IOException
-
writeHeader
This function is not used. Instead, use the RAWJP2Header class. Writes JP2 starting file header.- Throws:
IOException- DOCUMENT ME!
-
getModelLUT
-
createDecGui
private void createDecGui() -
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-