# HG changeset patch # User greg # Date 1509731500 14400 # Node ID 173c5c07b2f9ccfa0d55290b8ca8b233f0171b5b # Parent 5014ba48e15e655982eedcc8a4e493397c5c3ba4 Uploaded diff -r 5014ba48e15e -r 173c5c07b2f9 dmri.py --- a/dmri.py Fri Nov 03 13:46:21 2017 -0400 +++ b/dmri.py Fri Nov 03 13:51:40 2017 -0400 @@ -5,6 +5,7 @@ import shutil from dipy.data import fetch_sherbrooke_3shell +from matplotlib import pyplot parser = argparse.ArgumentParser() parser.add_argument('--input', dest='input', help='Input dataset') @@ -26,10 +27,10 @@ # non-weighted (S0s) and diffusion-weighted volumes. # Visualize the results using matplotlib. axial_middle = data.shape[2] // 2 -plt.figure('Showing the datasets') -plt.subplot(1, 2, 1).set_axis_off() -plt.imshow(data[:, :, axial_middle, 0].T, cmap='gray', origin='lower') -plt.subplot(1, 2, 2).set_axis_off() -plt.imshow(data[:, :, axial_middle, 10].T, cmap='gray', origin='lower') -plt.show() -plt.savefig(args.output, bbox_inches='tight') +pyplot.figure('Showing the datasets') +pyplot.subplot(1, 2, 1).set_axis_off() +pyplot.imshow(data[:, :, axial_middle, 0].T, cmap='gray', origin='lower') +pyplot.subplot(1, 2, 2).set_axis_off() +pyplot.imshow(data[:, :, axial_middle, 10].T, cmap='gray', origin='lower') +pyplot.show() +pyplot.savefig(args.output, bbox_inches='tight')