And use them to index into the data:
data = img.get_data()[roi_idx]
This dataset is not very noisy, so we will artificially corrupt it to simulate
After Change
hardi_fname, hardi_bval, hardi_bvec = dpd.get_fnames("stanford_hardi")
data, affine = load_nifti(hardi_fname)
bvals, bvecs = read_bvals_bvecs(hardi_bval, hardi_bvec)
gtab = gradient_table(bvals, bvecs)
We initialize a DTI model class instance using the gradient table used in the