Ejemplo n.º 1
0
import matplotlib.pyplot as plt

from dipy.reconst.ivim import IvimModel
from dipy.data.fetcher import read_ivim

"""
We get an IVIM dataset using DIPY_'s data fetcher ``read_ivim``.
This dataset was acquired with 21 b-values in 3 different directions.
Volumes corresponding to different directions were registered to each
other, and averaged across directions. Thus, this dataset has 4 dimensions,
with the length of the last dimension corresponding to the number
of b-values. In order to use this model the data should contain signals
measured at 0 bvalue.
"""

img, gtab = read_ivim()

"""
The variable ``img`` contains a nibabel NIfTI image object (with the data)
and gtab contains a GradientTable object (information about the gradients e.g.
b-values and b-vectors). We get the data from img using ``read_data``.
"""

data = img.get_data()
print('data.shape (%d, %d, %d, %d)' % data.shape)

"""
The data has 54 slices, with 256-by-256 voxels in each slice. The fourth
dimension corresponds to the b-values in the gtab. Let us visualize the data
by taking a slice midway(z=33) at $\mathbf{b} = 0$.
"""
Ejemplo n.º 2
0
"""

import matplotlib.pyplot as plt
from dipy.reconst.ivim import IvimModel
from dipy.data.fetcher import read_ivim
"""
We get an IVIM dataset using DIPY_'s data fetcher ``read_ivim``.
This dataset was acquired with 21 b-values in 3 different directions.
Volumes corresponding to different directions were registered to each
other, and averaged across directions. Thus, this dataset has 4 dimensions,
with the length of the last dimension corresponding to the number
of b-values. In order to use this model the data should contain signals
measured at 0 bvalue.
"""

img, gtab = read_ivim()
"""
The variable ``img`` contains a nibabel NIfTI image object (with the data)
and gtab contains a GradientTable object (information about the gradients e.g.
b-values and b-vectors). We get the data from img using ``read_data``.
"""

data = img.get_data()
print('data.shape (%d, %d, %d, %d)' % data.shape)
"""
The data has 54 slices, with 256-by-256 voxels in each slice. The fourth
dimension corresponds to the b-values in the gtab. Let us visualize the data
by taking a slice midway(z=33) at $\mathbf{b} = 0$.
"""

z = 33