changeset 21:53671fcb9507 draft

Uploaded
author greg
date Sun, 05 Nov 2017 07:33:21 -0500
parents fcdb8f5e9c8f
children 814082359f36
files dmri.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dmri.py	Sun Nov 05 07:33:10 2017 -0500
+++ b/dmri.py	Sun Nov 05 07:33:21 2017 -0500
@@ -10,15 +10,18 @@
 from matplotlib import pyplot
 
 parser = argparse.ArgumentParser()
-parser.add_argument('--input', dest='input', help='Input dataset')
+parser.add_argument('--drmi_dataset', dest='drmi_dataset', help='Input dataset')
 parser.add_argument('--output_nifti1', dest='output_nifti1', help='Output Nifti1 dataset')
 parser.add_argument('--output_png', dest='output_png', help='Output dataset')
 
 args = parser.parse_args()
 
-input_dir = 'sherbrooke_3shell'
 # Get input data.
-fetch_sherbrooke_3shell()
+input_dir = args.drmi_dataset
+if args.drmi_dataset == 'sherbrooke_3shell':
+    fetch_sherbrooke_3shell()
+elif args.drmi_dataset == 'stanford_hardi':
+    fetch_stanford_hardi()
 fdwi = os.path.join(input_dir, 'HARDI193.nii.gz')
 fbval = os.path.join(input_dir, 'HARDI193.bval')
 fbvec = os.path.join(input_dir, 'HARDI193.bvec')
@@ -30,7 +33,6 @@
 # non-weighted (S0s) and diffusion-weighted volumes.
 # Visualize the results using matplotlib.
 axial_middle = data.shape[2] // 2
-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()