Hi JP
Thanks for finding this issue. Would you mind placing a small 12-bit tiff online somewhere so that I can use it in the test suite?
It's strange that the matplotlib plugin is not available, since you mention that you have pylab. Can you import matplotlib without problems?
Regards
Stéfan
Dear all,
I meet some problem to open/display 12bits tif (16 bits) gray images.
I can open an image but I fail to display it:import skimageThen I get the following error:
path='/media/Elements__/Science/Biologie/QTeloFISH/myoblastes HPS/JPP55_nFF/16/DAPI'
image='/1.tif'
from skimage import io as io
print skimage.io.plugin_info('matplotlib')
#skimage.io.use_plugin('matplotlib', 'read')
#dapi=io.imread(path+image,plugin='matplotlib')
dapi=io.imread(path+image)
print type(dapi)
print type(dapi)
print 'dapi.dtype',dapi.dtype
io.imshow(dapi)
#import pylab
#pylab.imshow(dapi)
#pylab.show()
<type 'numpy.ndarray'>The default plugin is PIL.If I try to switch to matplotlib (or freeimage), the plugin doesn't seem available:
<type 'numpy.ndarray'>
dapi.dtype object
Traceback (most recent call last):
File "/home/claire/.spyder2/.temp.py", line 28, in <module>
io.imshow(dapi)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_io.py", line 149, in imshow
return call_plugin('imshow', arr, plugin=plugin, **plugin_args)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_plugins/plugin.py", line 88, in call
return func(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_plugins/pil_plugin.py", line 108, in imshow
Image.fromarray(arr).show()
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1886, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data typeTraceback (most recent call last):I can open the same image with plugin='pil' but I fail to display it:
File "/home/claire/.spyder2/.temp.py", line 16, in <module>
dapi=io.imread(path+image,plugin='matplotlib')
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_io.py", line 72, in imread
img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_plugins/plugin.py", line 86, in call
(plugin, kind))
RuntimeError: Could not find the plugin "matplotlib" for imread.uint16
(1024, 1536)
Traceback (most recent call last):
File "/home/claire/.spyder2/.temp.py", line 28, in <module>
io.imshow(dapi0)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_io.py", line 149, in imshow
return call_plugin('imshow', arr, plugin=plugin, **plugin_args)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_plugins/plugin.py", line 88, in call
return func(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/skimage-0.4-py2.6-linux-i686.egg/skimage/io/_plugins/pil_plugin.py", line 108, in imshow
Image.fromarray(arr).show()
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1886, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type
Does io.imshow() support only 8bits image?
I can open and display the image with readmagick/pylab.
Best regards
Jean-Patrick