Mercurial > repos > greg > drmi
comparison dmri.py @ 23:0c3113fdfae6 draft
Uploaded
author | greg |
---|---|
date | Sun, 05 Nov 2017 07:43:52 -0500 |
parents | 814082359f36 |
children | 88ff4adbfb2f |
comparison
equal
deleted
inserted
replaced
22:814082359f36 | 23:0c3113fdfae6 |
---|---|
18 | 18 |
19 # Get input data. | 19 # Get input data. |
20 input_dir = args.drmi_dataset | 20 input_dir = args.drmi_dataset |
21 if args.drmi_dataset == 'sherbrooke_3shell': | 21 if args.drmi_dataset == 'sherbrooke_3shell': |
22 fetch_sherbrooke_3shell() | 22 fetch_sherbrooke_3shell() |
23 fdwi = os.path.join(input_dir, 'HARDI193.nii.gz') | |
24 fbval = os.path.join(input_dir, 'HARDI193.bval') | |
25 fbvec = os.path.join(input_dir, 'HARDI193.bvec') | |
23 elif args.drmi_dataset == 'stanford_hardi': | 26 elif args.drmi_dataset == 'stanford_hardi': |
24 fetch_stanford_hardi() | 27 fetch_stanford_hardi() |
25 fdwi = os.path.join(input_dir, 'HARDI193.nii.gz') | 28 fdwi = os.path.join(input_dir, 'HARDI150.nii.gz') |
26 fbval = os.path.join(input_dir, 'HARDI193.bval') | 29 fbval = os.path.join(input_dir, 'HARDI150.bval') |
27 fbvec = os.path.join(input_dir, 'HARDI193.bvec') | 30 fbvec = os.path.join(input_dir, 'HARDI150.bvec') |
28 # Load the dMRI datasets. | 31 # Load the dMRI datasets. |
29 img = nibabel.load(fdwi) | 32 img = nibabel.load(fdwi) |
30 data = img.get_data() | 33 data = img.get_data() |
31 # data is a 4D array where the first 3 dimensions are the i, j, | 34 # data is a 4D array where the first 3 dimensions are the i, j, |
32 # k voxel coordinates and the last dimension is the number of | 35 # k voxel coordinates and the last dimension is the number of |