Package gov.nih.mipav.model.file
Class FileDM3
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileDM3
Some of this code is derived from DM3_Reader.java in ImageJ.
ImageJ disclaimer:
ImageJ is being developed at the National Institutes of Health by an employee of the Federal Government in the course of his official duties. Pursuant to Title 17, Section 105 of the United States Code, this software is not subject to copyright protection and is in the public domain. ImageJ is an experimental system. NIH assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intDOCUMENT ME!private long[]DOCUMENT ME!private int[]DOCUMENT ME!private static final intDOCUMENT ME!private intDOCUMENT ME!private static final intDOCUMENT ME!private booleanDOCUMENT ME!private int[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private String[]DOCUMENT ME!private int[][]DOCUMENT ME!private static final intDOCUMENT ME!private booleanDOCUMENT ME!private FileDOCUMENT ME!private intDOCUMENT ME!private StringDOCUMENT ME!private FileInfoDM3DOCUMENT ME!private FileInfoDM3private StringDOCUMENT ME!private intDOCUMENT ME!private static final intDOCUMENT ME!private intDOCUMENT ME!private ModelImageDOCUMENT ME!private intDOCUMENT ME!private int[]DOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private static final intDOCUMENT ME!private ModelLUTDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private int[]DOCUMENT ME!private static final intDOCUMENT ME!private float[][]DOCUMENT ME!private String[][]DOCUMENT ME!private int[]DOCUMENT ME!private ViewJProgressBarDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private static final intDifferent encoded data types used in DM3 files.private intDOCUMENT ME!private static final intDOCUMENT ME!private static final intDOCUMENT ME!private static final intDOCUMENT ME!private intDOCUMENT ME!private static final intDOCUMENT ME!Fields 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.returns LUT if defined.private voidDOCUMENT ME!private int[]DOCUMENT ME!private voidreadBuffer(int slice, float[] buffer) Reads a slice of data at a time and stores the results in the buffer.private voidreadComplexBuffer(int slice, float[] bufferR, float[] bufferI) Reads a slice of data at a time and stores the results in the buffer.private voidreadDBuffer(int slice, double[] buffer) Reads a slice of data at a time and stores the results in the buffer.private voidreadDComplexBuffer(int slice, double[] bufferR, double[] bufferI) Reads a slice of data at a time and stores the results in the buffer.readImage(boolean one) reads the DM3 file header and data.private voidreadLBuffer(int slice, long[] buffer) Reads a slice of data at a time and stores the results in the buffer.private voidreadSimpleData(int index, int encodedType) DOCUMENT ME!private voidDOCUMENT ME!private voidDOCUMENT ME!private int[]DOCUMENT ME!private voidreadTagEntry(int index) DOCUMENT ME!private voidDOCUMENT ME!private voidreadTagType(int index) DOCUMENT ME!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
-
SHORT
private static final int SHORTDifferent encoded data types used in DM3 files.- See Also:
-
LONG
private static final int LONGDOCUMENT ME!- See Also:
-
USHORT
private static final int USHORTDOCUMENT ME!- See Also:
-
ULONG
private static final int ULONGDOCUMENT ME!- See Also:
-
FLOAT
private static final int FLOATDOCUMENT ME!- See Also:
-
DOUBLE
private static final int DOUBLEDOCUMENT ME!- See Also:
-
BOOLEAN
private static final int BOOLEANDOCUMENT ME!- See Also:
-
CHAR
private static final int CHARDOCUMENT ME!- See Also:
-
OCTET
private static final int OCTETDOCUMENT ME!- See Also:
-
STRUCT
private static final int STRUCTDOCUMENT ME!- See Also:
-
STRING
private static final int STRINGDOCUMENT ME!- See Also:
-
ARRAY
private static final int ARRAYDOCUMENT ME!- See Also:
-
arrayLocationArray
private long[] arrayLocationArrayDOCUMENT ME! -
arraySizeArray
private int[] arraySizeArrayDOCUMENT ME! -
byteOrder
private int byteOrderDOCUMENT ME! -
dataEndianess
private boolean dataEndianessDOCUMENT ME! -
dataTypeArray
private int[] dataTypeArrayDOCUMENT ME! -
desiredArraySize
private int desiredArraySizeDOCUMENT ME! -
desiredImageNumber
private int desiredImageNumberDOCUMENT ME! -
desiredPixelUnitsArray
DOCUMENT ME! -
dimArray
private int[][] dimArrayDOCUMENT ME! -
endianess
private boolean endianessDOCUMENT ME! -
file
DOCUMENT ME! -
fileBytes
private int fileBytesDOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileInfoCopy
-
fileName
DOCUMENT ME! -
fileVersion
private int fileVersionDOCUMENT ME! -
identicalDesiredArraySize
private int identicalDesiredArraySizeDOCUMENT ME! -
image
DOCUMENT ME! -
imageNum
private int imageNumDOCUMENT ME! -
imgExtents
private int[] imgExtentsDOCUMENT ME! -
isCalibrations
private boolean isCalibrationsDOCUMENT ME! -
isData
private boolean isDataDOCUMENT ME! -
isDataType
private boolean isDataTypeDOCUMENT ME! -
isDimension
private boolean isDimensionDOCUMENT ME! -
isDimensions
private boolean isDimensionsDOCUMENT ME! -
isImageData
private boolean isImageDataDOCUMENT ME! -
isScale
private boolean isScaleDOCUMENT ME! -
isUnits
private boolean isUnitsDOCUMENT ME! -
LUT
DOCUMENT ME! -
nDimensions
private int nDimensionsDOCUMENT ME! -
numberSlices
private int numberSlicesDOCUMENT ME! -
numDimArray
private int[] numDimArrayDOCUMENT ME! -
pixelScaleArray
private float[][] pixelScaleArrayDOCUMENT ME! -
pixelUnitsArray
DOCUMENT ME! -
pixelUnitsNumber
private int[] pixelUnitsNumberDOCUMENT ME! -
progressBar
DOCUMENT ME! -
routineTagEntry
private int routineTagEntryDOCUMENT ME! -
routineTagGroup
private int routineTagGroupDOCUMENT ME! -
scaleIndex
private int scaleIndexDOCUMENT ME! -
sourceType
private int sourceTypeDOCUMENT ME! -
unitsIndex
private int unitsIndexDOCUMENT ME!
-
-
Constructor Details
-
FileDM3
DM3 reader 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. -
getModelLUT
returns LUT if defined.- Returns:
- the LUT if defined else it is null
-
readImage
reads the DM3 file header and data.- Parameters:
one- DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
IOException- if there is an error reading the file
-
readArray
DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readArrayTypes
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
IOException- DOCUMENT ME!
-
readBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybuffer- buffer where the info is stored- Throws:
IOException- if there is an error reading the file
-
readComplexBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybufferR- buffer where the real info is storedbufferI- buffer where the imaginary info is stored- Throws:
IOException- if there is an error reading the file
-
readDBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybuffer- buffer where the info is stored- Throws:
IOException- if there is an error reading the file
-
readDComplexBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybufferR- buffer where the real info is storedbufferI- buffer where the imaginary info is stored- Throws:
IOException- if there is an error reading the file
-
readLBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybuffer- buffer where the info is stored- Throws:
IOException- if there is an error reading the file
-
readSimpleData
DOCUMENT ME!- Parameters:
index- DOCUMENT ME!encodedType- DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readString
DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readStruct
DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readStructTypes
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
IOException- DOCUMENT ME!
-
readTagEntry
DOCUMENT ME!- Parameters:
index- DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readTagGroup
DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-
readTagType
DOCUMENT ME!- Parameters:
index- DOCUMENT ME!- Throws:
IOException- DOCUMENT ME!
-