Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db3d206

Browse files
committed
Add a top dosctring and perform small cleaning/fixing ops to mri_with_eeg.py
1 parent dfc9cca commit db3d206

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

examples/pylab_examples/mri_demo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
from __future__ import print_function
1+
"""Displays an MRI image."""
2+
23
import matplotlib.pyplot as plt
34
import matplotlib.cbook as cbook
45
import numpy as np
5-
# data are 256x256 16 bit integers
6+
7+
# Data are 256x256 16 bit integers
68
dfile = cbook.get_sample_data('s1045.ima.gz')
79
im = np.fromstring(dfile.read(), np.uint16).astype(float)
8-
im.shape = 256, 256
10+
im.shape = (256, 256)
11+
dfile.close()
912

1013
plt.imshow(im, cmap=plt.cm.gray)
1114
plt.axis('off')

0 commit comments

Comments
 (0)