data

Module: data.saved_acquisition_schemes

dmipy.data.saved_acquisition_schemes.wu_minn_hcp_acquisition_scheme()

Returns DmipyAcquisitionScheme of Wu-Minn HCP project.

dmipy.data.saved_acquisition_schemes.duval_cat_spinal_cord_2d_acquisition_scheme()

Returns 2D DmipyAcquisitionScheme of cat spinal cord data.

Module: data.saved_data

dmipy.data.saved_data.wu_minn_hcp_coronal_slice()

Returns example slice of Wu-Minn HCP data subject 100307.

dmipy.data.saved_data.duval_cat_spinal_cord_2d()

Returns 2D multi-diffusion time AxCaliber data of cat spinal cord.

dmipy.data.saved_data.synthetic_camino_data_parallel()

The parallel data was generated using the Camino Monte-Carlo Diffusion Simulator. See http://camino.cs.ucl.ac.uk/.

dmipy.data.saved_data.synthetic_camino_data_dispersed()

The dispersed data was generated by using the parallel Camino data as an described above, and then dispersing it using Watson and Bingham distributions.

dmipy.data.saved_data.visualize_correlation_camino_and_estimated_fractions(estim_fractions_parallel, estim_fractions_dispersed)

Function that visualizes Camino estimated results versus ground truth.

acquisition_scheme_from_bvalues

dmipy.data.saved_acquisition_schemes.acquisition_scheme_from_bvalues(bvalues, gradient_directions, delta, Delta, TE=None, min_b_shell_distance=50000000.0, b0_threshold=10000000.0)

Creates an acquisition scheme object from bvalues, gradient directions, pulse duration \(\delta\) and pulse separation time \(\Delta\).

Parameters:

bvalues: 1D numpy array of shape (Ndata) :

bvalues of the acquisition in s/m^2. e.g., a bvalue of 1000 s/mm^2 must be entered as 1000 * 1e6 s/m^2

gradient_directions: 2D numpy array of shape (Ndata, 3) :

gradient directions array of cartesian unit vectors.

delta: float or 1D numpy array of shape (Ndata) :

if float, pulse duration of every measurements in seconds. if array, potentially varying pulse duration per measurement.

Delta: float or 1D numpy array of shape (Ndata) :

if float, pulse separation time of every measurements in seconds. if array, potentially varying pulse separation time per measurement.

min_b_shell_distance : float

minimum bvalue distance between different shells. This parameter is used to separate measurements into different shells, which is necessary for any model using spherical convolution or spherical mean.

b0_threshold : float

bvalue threshold for a measurement to be considered a b0 measurement.

Returns:

DmipyAcquisitionScheme: acquisition scheme object :

contains all information of the acquisition scheme to be used in any microstructure model.

acquisition_scheme_from_gradient_strengths

dmipy.data.saved_acquisition_schemes.acquisition_scheme_from_gradient_strengths(gradient_strengths, gradient_directions, delta, Delta, TE=None, min_b_shell_distance=50000000.0, b0_threshold=10000000.0)

Creates an acquisition scheme object from gradient strengths, gradient directions pulse duration \(\delta\) and pulse separation time \(\Delta\).

Parameters:

gradient_strengths: 1D numpy array of shape (Ndata) :

gradient strength of the acquisition in T/m. e.g., a gradient strength of 300 mT/m must be entered as 300 / 1e3 T/m

gradient_directions: 2D numpy array of shape (Ndata, 3) :

gradient directions array of cartesian unit vectors.

delta: float or 1D numpy array of shape (Ndata) :

if float, pulse duration of every measurements in seconds. if array, potentially varying pulse duration per measurement.

Delta: float or 1D numpy array of shape (Ndata) :

if float, pulse separation time of every measurements in seconds. if array, potentially varying pulse separation time per measurement.

min_b_shell_distance : float

minimum bvalue distance between different shells. This parameter is used to separate measurements into different shells, which is necessary for any model using spherical convolution or spherical mean.

b0_threshold : float

bvalue threshold for a measurement to be considered a b0 measurement.

Returns:

DmipyAcquisitionScheme: acquisition scheme object :

contains all information of the acquisition scheme to be used in any microstructure model.

acquisition_scheme_from_schemefile

dmipy.data.saved_acquisition_schemes.acquisition_scheme_from_schemefile(file_path, min_b_shell_distance=50000000.0, b0_threshold=10000000.0)

Created an acquisition scheme object from a Camino scheme file, containing gradient directions, strengths, pulse duration \(\delta\) and pulse separation time \(\Delta\) and TE.

Parameters:

file_path: string :

absolute file path to schemefile location

Returns:

DmipyAcquisitionScheme: acquisition scheme object :

contains all information of the acquisition scheme to be used in any microstructure model.

duval_cat_spinal_cord_2d_acquisition_scheme

dmipy.data.saved_acquisition_schemes.duval_cat_spinal_cord_2d_acquisition_scheme()

Returns 2D DmipyAcquisitionScheme of cat spinal cord data.

duval_cat_spinal_cord_3d_acquisition_scheme

dmipy.data.saved_acquisition_schemes.duval_cat_spinal_cord_3d_acquisition_scheme()

Returns 3D DmipyAcquisitionScheme of cat spinal cord data.

isbi2015_white_matter_challenge_scheme

dmipy.data.saved_acquisition_schemes.isbi2015_white_matter_challenge_scheme()

Returns 35-shell ISBI 2015 challenge DmipyAcquisitionScheme.

join

dmipy.data.saved_acquisition_schemes.join(a, *p)

Join two or more pathname components, inserting ‘/’ as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.

panagiotaki_verdict_acquisition_scheme

dmipy.data.saved_acquisition_schemes.panagiotaki_verdict_acquisition_scheme()

Returns acquisition scheme for VERDICT tumor characterization.

urlopen

dmipy.data.saved_acquisition_schemes.urlopen(url, data=None, timeout=<object object>, cafile=None, capath=None, cadefault=False, context=None)

wu_minn_hcp_acquisition_scheme

dmipy.data.saved_acquisition_schemes.wu_minn_hcp_acquisition_scheme()

Returns DmipyAcquisitionScheme of Wu-Minn HCP project.

duval_cat_spinal_cord_2d

dmipy.data.saved_data.duval_cat_spinal_cord_2d()

Returns 2D multi-diffusion time AxCaliber data of cat spinal cord.

duval_cat_spinal_cord_3d

dmipy.data.saved_data.duval_cat_spinal_cord_3d()

Returns 2D multi-diffusion time AxCaliber data of cat spinal cord.

isbi2015_white_matter_challenge

dmipy.data.saved_data.isbi2015_white_matter_challenge()

Downloads and returns the 35-shell multi-delta/Delta/G scheme and data for the fornix and genu data that was used for the ISBI 2015 white matter challenge [R7].

Returns:

scheme: DmipyAcquisitionScheme instance, :

acquisition scheme of the challenge data.

data_genu: array of size (3612, 6), :

contains the DWIs for 6 genu voxels.

data_fornix: array of size (3612, 6), :

contains the DWIs for 6 fornix voxels.

References

[R7](1, 2) Ferizi, Uran, et al. “Diffusion MRI microstructure models with in vivo human brain Connectome data: results from a multi-group comparison.” NMR in Biomedicine 30.9 (2017)

join

dmipy.data.saved_data.join(a, *p)

Join two or more pathname components, inserting ‘/’ as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.

panagiotaki_verdict

dmipy.data.saved_data.panagiotaki_verdict()

Downloads and returns the example VERDICT acquisition scheme and data that is available at the UCL website. The data is an example of [R8].

Returns:

scheme: DmipyAcquisitionScheme instance, :

acquisition scheme of the challenge data.

data_verdict: array, :

contains the DWIs for a single tumor voxel.

References

[R8](1, 2) Panagiotaki, Eletheria, et al. “Noninvasive quantification of solid tumor microstructure using VERDICT MRI.” Cancer research 74.7 (2014): 1902-1912.

pearsonr

dmipy.data.saved_data.pearsonr(x, y)

Calculate a Pearson correlation coefficient and the p-value for testing non-correlation.

The Pearson correlation coefficient measures the linear relationship between two datasets. Strictly speaking, Pearson’s correlation requires that each dataset be normally distributed, and not necessarily zero-mean. Like other correlation coefficients, this one varies between -1 and +1 with 0 implying no correlation. Correlations of -1 or +1 imply an exact linear relationship. Positive correlations imply that as x increases, so does y. Negative correlations imply that as x increases, y decreases.

The p-value roughly indicates the probability of an uncorrelated system producing datasets that have a Pearson correlation at least as extreme as the one computed from these datasets. The p-values are not entirely reliable but are probably reasonable for datasets larger than 500 or so.

Parameters:

x : (N,) array_like

Input

y : (N,) array_like

Input

Returns:

r : float

Pearson’s correlation coefficient

p-value : float

2-tailed p-value

Notes

The correlation coefficient is calculated as follows:

\[r_{pb} = \frac{\sum (x - m_x) (y - m_y) }{\sqrt{\sum (x - m_x)^2 (y - m_y)^2}}\]

where \(m_x\) is the mean of the vector \(x\) and \(m_y\) is the mean of the vector \(y\).

References

http://www.statsoft.com/textbook/glosp.html#Pearson%20Correlation

Examples

>>> from scipy import stats
>>> a = np.array([0, 0, 0, 1, 1, 1, 1])
>>> b = np.arange(7)
>>> stats.pearsonr(a, b)
(0.8660254037844386, 0.011724811003954654)
>>> stats.pearsonr([1,2,3,4,5], [5,6,7,8,7])
(0.83205029433784372, 0.080509573298498519)

synthetic_camino_data_dispersed

dmipy.data.saved_data.synthetic_camino_data_dispersed()

The dispersed data was generated by using the parallel Camino data as an described above, and then dispersing it using Watson and Bingham distributions.

synthetic_camino_data_parallel

dmipy.data.saved_data.synthetic_camino_data_parallel()

The parallel data was generated using the Camino Monte-Carlo Diffusion Simulator. See http://camino.cs.ucl.ac.uk/.

urlopen

dmipy.data.saved_data.urlopen(url, data=None, timeout=<object object>, cafile=None, capath=None, cadefault=False, context=None)

visualize_correlation_camino_and_estimated_fractions

dmipy.data.saved_data.visualize_correlation_camino_and_estimated_fractions(estim_fractions_parallel, estim_fractions_dispersed)

Function that visualizes Camino estimated results versus ground truth.

wu_minn_hcp_coronal_slice

dmipy.data.saved_data.wu_minn_hcp_coronal_slice()

Returns example slice of Wu-Minn HCP data subject 100307.