[ome-users] Bug in Deltavision file reader.
Ian Dobbie
ian.dobbie at bioch.ox.ac.uk
Tue Dec 17 22:29:38 GMT 2013
Hi Everyone,
I have discovered a slight bug in the delatvision file reader. It is to
do with reading data that is 64 bit complex. The reason this comes up is
trying to read OMX .otf files.
I believe the bug is in the code below. The code correctly identifies
the image type as complex in the getPixelString call but then doesn't do
anything with the information and just returns the a type FLOAT (which I
assume is a 32 bit number) in the getPixelType call. The 64 bit complex
data is actually a pair of floats for real and imaginary parts and I
guess to read it properly you need to create an image twice as large, or
more likely two images, one for real component and one for the imaginary
part. I suspect that this might be complicated!
The following code is from bioformats/components/bio-formats/src/loci/formats/in/DeltavisionReader.java
Somewhere about line 750.
----------------------------------------------------------------------
/** Get a descriptive string representing the pixel type. */
private String getPixelString(int filePixelType) {
switch (filePixelType) {
case 0:
return "8 bit unsigned integer";
case 1:
return "16 bit signed integer";
case 2:
return "32 bit floating point";
case 3:
return "16 bit complex";
case 4:
return "64 bit complex";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Correctly identified.
case 6:
return "16 bit unsigned integer";
}
return "unknown";
}
/** Get the OME pixel type from the pixel type stored in the file. */
private int getPixelType(int filePixelType) {
switch (filePixelType) {
case 0:
return FormatTools.UINT8;
case 1:
return FormatTools.INT16;
case 2:
return FormatTools.FLOAT;
case 3:
return FormatTools.INT16;
case 4:
return FormatTools.FLOAT;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
But then just returns a single Float array to store the data in.
case 6:
return FormatTools.UINT16;
}
return FormatTools.UINT8;
----------------------------------------------------------------------
Ian
Ps. This bug was acually discovered by Graeme Ball but he is swamped
with other things to deal with so I am shamelessly grabbing the glory.
More information about the ome-users
mailing list