Trying to read a 16-bit grayscale TIFF image saved with OpenCV in Python, and I’m getting the error:
ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\IO\Image\vtkTIFFReader.cxx, line 1136
vtkTIFFReader (0000027E675D81C0): Problem reading slice of volume in TIFF file.
The same error message appears in this thread from the old mailing list. Image properties from metadata:
Exif.Image.BitsPerSample = 16 16 16
Exif.Image.Compression = LZW
Exif.Image.ImageLength = 120
Exif.Image.ImageWidth = 160
Exif.Image.Orientation = top, left
Exif.Image.PhotometricInterpretation = Black Is Zero
Exif.Image.PlanarConfiguration = 1
Exif.Image.Predictor = Horizontal differencing
Exif.Image.ResolutionUnit = inch
Exif.Image.RowsPerStrip = 25
Exif.Image.SamplesPerPixel = 1
Exif.Image.StripByteCounts = 4189 4188 4338 4119 3429
Exif.Image.StripOffsets = 8 4197 8385 12723 16842
Exif.Image.XResolutoin = 300
Exif.Image.YResolution = 300
Exif.Photo.ColorSpace = sRGB
Because the extension is .tif, I get the option of two readers, either GDAL Raster Reader (works for a single image but not a sequence) or TIFF Series Reader (gives error above, whether the image is alone or is actually part of a series titled seq_0000xx.tif
for xx=0 to 40. Read As Image Stack
is unchecked, representation can be surface or slice, coloring is set to Tiff scalars. Everything else is default.
These are plain 16-bit grayscale TIFF files, no pages or anything in them. Information
tab shows data is read as unsigned short.
Client Information:
Version: 5.10.0-RC1
VTK Version:
Qt Version: 5.15.2
vtkIdType size: 64bits
Embedded Python: On
Python Library Path: C:\Program Files\ParaView 5.10.0\bin\lib
Python Library Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Python Numpy Support: On
Python Numpy Path: C:\Program Files\ParaView 5.10.0\bin\Lib\site-packages\numpy
Python Numpy Version: 1.21.1
Python Matplotlib Support: On
Python Matplotlib Path: C:\Program Files\ParaView 5.10.0\bin\Lib\site-packages\matplotlib
Python Matplotlib Version: 3.2.1
Python Testing: Off
MPI Enabled: Off
ParaView Build ID: superbuild 804a787c9ac8f9b0f8abc7c3001d1e61eeb15208 (!922)
Disable Registry: Off
Test Directory:
Data Directory:
SMP Backend: TBB
SMP Max Number of Threads: 12
OpenGL Vendor: Intel
OpenGL Version: 3.2.0 - Build 27.20.100.9664
OpenGL Renderer: Intel(R) UHD Graphics
Connection Information:
Remote Connection: No
Here are sample images:
seq_0000000.tif (20.0 KB)
seq_0000001.tif (20.0 KB)
seq_0000002.tif (20.1 KB)
seq_0000003.tif (20.0 KB)
The data originates from a thermal camera which gives raw 12-bit data, so changing the format isn’t too much of an issue but this should work.