from dipy.reconst import mapmri from dipy.viz import fvtk from dipy.data import fetch_cenir_multib, read_cenir_multib, get_sphere from dipy.core.gradients import gradient_table import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable """ Download and read the data for this tutorial. MAPMRI requires multi-shell data, to properly fit the radial part of the basis. The total size of the downloaded data is 1760 MBytes, however you only need to fetch it once. Parameter ``with_raw`` of function ``fetch_cenir_multib`` is set to ``False`` to only download eddy-current/motion corrected data:. """ fetch_cenir_multib(with_raw=False) """ For this example we select only the shell with b-values equal to the one of the Human Connectome Project (HCP). data contains the voxel data and gtab contains a GradientTable object (gradient information e.g. b-values). For example, to show the b-values it is possible to write print(gtab.bvals). For the values of the q-space indices to make sense it is necessary to explicitly state the big_delta and small_delta parameters in the gradient table. """ bvals = [1000, 2000, 3000] img, gtab = read_cenir_multib(bvals)
from dipy.data import fetch_cenir_multib from dipy.data import read_cenir_multib from dipy.segment.mask import median_otsu from dipy.denoise.noise_estimate import estimate_sigma from dipy.denoise.nlmeans import nlmeans """ DKI requires multi-shell data, i.e. data acquired from more than one non-zero b-value. Here, we use fetch to download a multi-shell dataset with parameters that are similar to the data collected in the Human Connectome Project (HCP). The total size of the downloaded data is 1760 MBytes, however you only need to fetch it once. Parameter ``with_raw`` of function ``fetch_cenir_multib`` is set to ``False`` to only download eddy-current/motion corrected data: """ fetch_cenir_multib(with_raw=False) """ Next, we read the saved dataset. To decrease the influence of diffusion signal Taylor approximation components larger than the fourth order (componets not taken into account by the diffusion kurtosis tensor), we only select the b-values up to 2000 $s.mm^{-2}$: """ bvals = [200, 400, 1000, 2000] img, gtab = read_cenir_multib(bvals) data = img.get_data() affine = img.get_affine()