|
From: <jd...@us...> - 2009-08-05 17:21:17
|
Revision: 7390
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7390&view=rev
Author: jdh2358
Date: 2009-08-05 17:21:09 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
fixed another example to use sample data
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/mri_demo.py
Modified: trunk/matplotlib/examples/pylab_examples/mri_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/mri_demo.py 2009-08-05 17:20:12 UTC (rev 7389)
+++ trunk/matplotlib/examples/pylab_examples/mri_demo.py 2009-08-05 17:21:09 UTC (rev 7390)
@@ -1,9 +1,10 @@
#!/usr/bin/env python
from pylab import *
-
+import matplotlib.cbook as cbook
# data are 256x256 16 bit integers
-dfile = '../data/s1045.ima'
-im = fromstring(file(dfile, 'rb').read(), uint16).astype(float)
+dfile = cbook.get_sample_data('s1045.ima', asfileobj=False)
+print 'loading image', dfile
+im = np.fromstring(file(dfile, 'rb').read(), np.uint16).astype(float)
im.shape = 256, 256
#imshow(im, ColormapJet(256))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|