Module Contents#


fit_csd(data_files, bval_files, bvec_files[, mask, ...])

Fit the CSD model and save file with SH coefficients.

AFQ.models.csd.fit_csd(data_files, bval_files, bvec_files, mask=None, response=None, b0_threshold=50, sh_order=None, lambda_=1, tau=0.1, out_dir=None)[source]#

Fit the CSD model and save file with SH coefficients.

data_filesstr or list.

Files containing DWI data. If this is a str, that’s the full path to a single file. If it’s a list, each entry is a full path.

bval_filesstr or list.

Equivalent to data_files.

bvec_filesstr or list.

Equivalent to data_files.

maskndarray, optional.

Binary mask, set to True or 1 in voxels to be processed. Default: Process all voxels.

response: tuple, optional.

The response function to be used by CSD, as a tuple with two elements. The first is the eigen-values as an (3,) ndarray and the second is the signal value for the response function without diffusion-weighting (i.e. S0). If not provided, auto_response will be used to calculate these values.


The value of diffusion-weighting under which we consider it to be equivalent to 0. Default:50

sh_orderint, optional.

default: infer the number of parameters from the number of data volumes, but no larger than 8.

lambda_float, optional.

weight given to the constrained-positivity regularization part of the deconvolution equation. Default: 1

taufloat, optional.

threshold controlling the amplitude below which the corresponding fODF is assumed to be zero. Ideally, tau should be set to zero. However, to improve the stability of the algorithm, tau is set to tau*100 % of the mean fODF amplitude (here, 10% by default) (see [1]). Default: 0.1

out_dirstr, optional

A full path to a directory to store the maps that get computed. Default: file with coefficients gets stored in the same directory as the first DWI file in data_files.

fnamethe full path to the file containing the SH coefficients.



Tournier, J.D., et al. NeuroImage 2007. Robust determination of the fibre orientation distribution in diffusion MRI: Non-negativity constrained super-resolved spherical deconvolution