Package gov.nih.mipav.model.file
Class FileZVI
- java.lang.Object
-
- gov.nih.mipav.model.file.FileBase
-
- gov.nih.mipav.model.file.FileZVI
-
public class FileZVI extends FileBase
Documentation used was the ZVI Format Specification V 2.0.5 - August, 2010. The following email was sent to Zeiss support: Here are problems I spotted in ZVI Format Specification V 2.0.5 - August, 2010: 2.1.1stream of the container image: TypeDescription is VT_EMPTY rather than VT_BSTR FileName is VT_EMPTY rather than VT_BSTR m_PluginCLSID is VT_BLOB rather than VT_CLSID The {Tags} VT_STORED_OBJECT that goes between the {Layers} and {Scaling} VT_STORED_OBJECTs is missing. 2.2.1 stream of the image item: Version is used rather than unused with minor = 1003 hex and major = 3000 hex. TypeDescription is VT_EMPTY rather than VT_BSTR. FileName is VT_EMPTY rather than VT_BSTR m_PluginCLSID is VT_BLOB rather than VT_CLSID Items after the {Others} VT_BLOB are completely different from what's listed. I find: VT_DISPATCH VT_STORED_OBJECT with a string = Tags VT_DISPATCH VT_DISPATCH VT_DISPATCH RAW pixel data 3.3 Coordinate ID for Image Dimensions: Index should be 0 1 2 3 4 5 6 7 instead of the existing 0 1 3 4 5 6 7 8. 3.4 Tag IDs ID 301 is used for both ImageBaseTimeFirst and ImageBaseTime1. I suspect the ImageBaseTimeFirst entry should be deleted. The following tags show up in .ZVI files but are not listed in your table: 2071, 20478. What is the info for these tags? 65781 has both AuroxCamRes6 and AuroxCamCFactor. Information for decoding the 64-bit VT_DATE structure is missing. Is it available somewhere? Is it possible for me to obtain sample .ZVI files so I can improve the ZVI file read in the MIPAV image processing program? Sincerely, William Gandler
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
add128
private int
ap
private int
backupZDim
private double[]
cameraImageAcquisitionTime
private int[]
cArray
private int
channelNumber
private boolean
endianess
private java.io.File
file
DOCUMENT ME!private java.lang.String
fileDir
DOCUMENT ME!private FileInfoZVI
fileInfo
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private int
icp
private int
icp2
private int
icp3
private int
icp4
private int
icp5
private int
icp6
private int
icp7
private int
icpOriginalX
private int
icpOriginalY
private int
icpX
private int
icpY
private ModelImage
image
DOCUMENT ME!private double[]
imageBlackValueArray
private int[]
imageC2Array
private int[]
imageC3Array
private int[]
imageC6Array
private int[]
imageC7Array
private int
imageCount
private int[]
imageExtents
DOCUMENT ME!private double[]
imageFocusPositionArray
private int
imageHeight
private double[]
imageOriginalStagePositionXArray
private double[]
imageOriginalStagePositionYArray
private int[]
imageOriginalZXArray
private int[]
imageOriginalZYArray
private int
imagePixelFormat
private double[]
imageRelativeTime
private double[]
imageRelFocusPosition1Array
private double[]
imageRelFocusPosition2Array
private double[]
imageStagePositionXArray
private double[]
imageStagePositionYArray
private int[]
imageT2Array
private int[]
imageT3Array
private int[]
imageT6Array
private int[]
imageT7Array
private double[]
imageWhiteValueArray
private int
imageWidth
private int[]
imageZ2Array
private int[]
imageZ3Array
private int[]
imageZ4Array
private int[]
imageZ5Array
private int[]
imageZ6Array
private int[]
imageZ7Array
private int[]
imageZArray
private int[]
imageZXArray
private int[]
imageZYArray
private float[]
imgBuffer
DOCUMENT ME!private float[]
imgResols
DOCUMENT ME!private ModelLUT
LUT
DOCUMENT ME!private int
maxC
private int
maxPosition
private int
maxT
private int
maxZ
private int
minC
private int
minPosition
private int
minT
private int
minZ
private int[]
offsetArray
private int[]
positionArray
private int
positionNumber
private int[]
sat
private int
sectorSize
private int
shortSectorSize
private int[]
shortSectorTable
private int
shortStreamStartSect
private int[]
startSectorArray
private int[]
tArray
private int
tDim
private long
totalShortStreamSize
private static short
VT_BLOB
private static short
VT_BOOL
private static short
VT_BSTR
private static short
VT_DATE
private static short
VT_DISPATCH
private static short
VT_EMPTY
private static short
VT_I2
private static short
VT_I4
private static short
VT_R8
private static short
VT_STORED_OBJECT
private int[]
zArray
private int
zDim
-
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 FileZVI(java.lang.String fileName, java.lang.String fileDir)
ZVI reader constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
calculateRelativeTime(double relativeTime)
(package private) java.lang.String
calculateTimeStampString(long timeStamp)
private java.lang.String
calculateVTDateTimeString(double dateTime)
private void
displayPixelFormat(int pixelFormat)
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.boolean
readHeader()
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.private int
zviToMipavMeasurementUnits(int zviScalingUnit)
-
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
-
VT_EMPTY
private static final short VT_EMPTY
- See Also:
- Constant Field Values
-
VT_BOOL
private static final short VT_BOOL
- See Also:
- Constant Field Values
-
VT_I2
private static final short VT_I2
- See Also:
- Constant Field Values
-
VT_I4
private static final short VT_I4
- See Also:
- Constant Field Values
-
VT_R8
private static final short VT_R8
- See Also:
- Constant Field Values
-
VT_BSTR
private static final short VT_BSTR
- See Also:
- Constant Field Values
-
VT_STORED_OBJECT
private static final short VT_STORED_OBJECT
- See Also:
- Constant Field Values
-
VT_DATE
private static final short VT_DATE
- See Also:
- Constant Field Values
-
VT_DISPATCH
private static final short VT_DISPATCH
- See Also:
- Constant Field Values
-
VT_BLOB
private static final short VT_BLOB
- See Also:
- Constant Field Values
-
file
private java.io.File file
DOCUMENT ME!
-
fileDir
private java.lang.String fileDir
DOCUMENT ME!
-
fileInfo
private FileInfoZVI 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!
-
endianess
private boolean endianess
-
sectorSize
private int sectorSize
-
shortSectorSize
private int shortSectorSize
-
shortSectorTable
private int[] shortSectorTable
-
shortStreamStartSect
private int shortStreamStartSect
-
totalShortStreamSize
private long totalShortStreamSize
-
imageWidth
private int imageWidth
-
imageHeight
private int imageHeight
-
imageCount
private int imageCount
-
imagePixelFormat
private int imagePixelFormat
-
zDim
private int zDim
-
backupZDim
private int backupZDim
-
tDim
private int tDim
-
channelNumber
private int channelNumber
-
positionNumber
private int positionNumber
-
zArray
private int[] zArray
-
cArray
private int[] cArray
-
tArray
private int[] tArray
-
positionArray
private int[] positionArray
-
startSectorArray
private int[] startSectorArray
-
offsetArray
private int[] offsetArray
-
ap
private int ap
-
imageFocusPositionArray
private double[] imageFocusPositionArray
-
imageStagePositionXArray
private double[] imageStagePositionXArray
-
imageZXArray
private int[] imageZXArray
-
imageZYArray
private int[] imageZYArray
-
imageStagePositionYArray
private double[] imageStagePositionYArray
-
imageOriginalStagePositionXArray
private double[] imageOriginalStagePositionXArray
-
imageOriginalZXArray
private int[] imageOriginalZXArray
-
imageOriginalZYArray
private int[] imageOriginalZYArray
-
imageOriginalStagePositionYArray
private double[] imageOriginalStagePositionYArray
-
imageZArray
private int[] imageZArray
-
imageZ2Array
private int[] imageZ2Array
-
imageC2Array
private int[] imageC2Array
-
imageT2Array
private int[] imageT2Array
-
imageBlackValueArray
private double[] imageBlackValueArray
-
imageZ3Array
private int[] imageZ3Array
-
imageC3Array
private int[] imageC3Array
-
imageT3Array
private int[] imageT3Array
-
imageWhiteValueArray
private double[] imageWhiteValueArray
-
imageRelFocusPosition1Array
private double[] imageRelFocusPosition1Array
-
imageZ4Array
private int[] imageZ4Array
-
imageRelFocusPosition2Array
private double[] imageRelFocusPosition2Array
-
imageZ5Array
private int[] imageZ5Array
-
cameraImageAcquisitionTime
private double[] cameraImageAcquisitionTime
-
imageZ6Array
private int[] imageZ6Array
-
imageC6Array
private int[] imageC6Array
-
imageT6Array
private int[] imageT6Array
-
imageRelativeTime
private double[] imageRelativeTime
-
imageZ7Array
private int[] imageZ7Array
-
imageC7Array
private int[] imageC7Array
-
imageT7Array
private int[] imageT7Array
-
icp
private int icp
-
icp2
private int icp2
-
icp3
private int icp3
-
icp4
private int icp4
-
icp5
private int icp5
-
icp6
private int icp6
-
icp7
private int icp7
-
icpX
private int icpX
-
icpY
private int icpY
-
icpOriginalX
private int icpOriginalX
-
icpOriginalY
private int icpOriginalY
-
sat
private int[] sat
-
add128
private boolean add128
-
minC
private int minC
-
maxC
private int maxC
-
minZ
private int minZ
-
maxZ
private int maxZ
-
minT
private int minT
-
maxT
private int maxT
-
minPosition
private int minPosition
-
maxPosition
private int maxPosition
-
-
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
-
readHeader
public boolean readHeader() throws java.io.IOException
- Throws:
java.io.IOException
-
zviToMipavMeasurementUnits
private int zviToMipavMeasurementUnits(int zviScalingUnit)
-
displayPixelFormat
private void displayPixelFormat(int pixelFormat)
-
calculateTimeStampString
java.lang.String calculateTimeStampString(long timeStamp)
-
calculateVTDateTimeString
private java.lang.String calculateVTDateTimeString(double dateTime)
-
calculateRelativeTime
private java.lang.String calculateRelativeTime(double relativeTime)
-
-