Opening a .tif image using matplotlib Python -


i pretty new python , trying load .tif image following code in order later mark dots @ various x , y coordinates.

import matplotlib.pyplot plt import matplotlib.image mpimg image = mpimg.imread("mothtest.tif") plt.imshow(image) plt.show() 

i've used following image: enter image description here

and produces following errors:

  file "<ipython-input-1-69a4ce2424d3>", line 1, in <module>     runfile('z:/04projects internal/gemultiplexerproject/method/statisticalmethods/cell arangement app/python app/centroid_lut.py', wdir='z:/04projects internal/gemultiplexerproject/method/statisticalmethods/cell arangement app/python app')    file "c:\users\michaela\anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile     execfile(filename, namespace)    file "c:\users\michaela\anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile     exec(compile(scripttext, filename, 'exec'), glob, loc)    file "z:/04projects internal/gemultiplexerproject/method/statisticalmethods/cell arangement app/python app/centroid_lut.py", line 29, in <module>     image = mpimg.imread("mothtest.tif")    file "c:\users\michaela\anaconda2\lib\site-packages\matplotlib\image.py", line 1278, in imread     im = pilread(fname)    file "c:\users\michaela\anaconda2\lib\site-packages\matplotlib\image.py", line 1256, in pilread     image.open(fname) image:    file "c:\users\michaela\anaconda2\lib\site-packages\pil\image.py", line 512, in __getattr__     raise attributeerror(name)  attributeerror: __exit__ 

does happen know how work around this? appreciated!

according documentation here pillow, pil , pillow cannot coexist in same environment. had installed pil, after uninstalled pil , installed pillow 3.0 this link, worked smoothly code posted above.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -