Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c49b9a commit 4d6c905Copy full SHA for 4d6c905
1 file changed
examples/pylab_examples/mri_demo.py
@@ -1,9 +1,10 @@
1
#!/usr/bin/env python
2
from pylab import *
3
-
+import matplotlib.cbook as cbook
4
# data are 256x256 16 bit integers
5
-dfile = '../data/s1045.ima'
6
-im = fromstring(file(dfile, 'rb').read(), uint16).astype(float)
+dfile = cbook.get_sample_data('s1045.ima', asfileobj=False)
+print 'loading image', dfile
7
+im = np.fromstring(file(dfile, 'rb').read(), np.uint16).astype(float)
8
im.shape = 256, 256
9
10
#imshow(im, ColormapJet(256))
0 commit comments