# HG changeset patch # User greg # Date 1509885201 18000 # Node ID 53671fcb9507c1e025780670fac1ea18460ef5a0 # Parent fcdb8f5e9c8fe5b63a47468e576da2a9cdbc01c6 Uploaded diff -r fcdb8f5e9c8f -r 53671fcb9507 dmri.py --- 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()