qsirecon.workflows.recon.dipy module

Dipy Reconstruction workflows

qsirecon.workflows.recon.dipy.init_dipy_brainsuite_shore_recon_wf(inputs_dict, name='dipy_3dshore_recon', qsirecon_suffix='', params={})[source]

Reconstruct EAPs, ODFs, using 3dSHORE (brainsuite-style basis set).

Inputs

qsirecon outputs

Outputs

shore_coeffs

3dSHORE coefficients

rtop

Voxelwise Return-to-origin probability.

rtap

Voxelwise Return-to-axis probability.

rtpp

Voxelwise Return-to-plane probability.

Params

write_fibgz: bool

True writes out a DSI Studio fib file

write_mif: bool

True writes out a MRTrix mif file with sh coefficients

convert_to_multishell: str

either “HCP”, “ABCD”, “lifespan” will resample the data with this scheme

radial_order: int

Radial order for spherical harmonics (even)

zeta: float

Zeta parameter for basis set.

tau:float

Diffusion parameter (default= 4 * np.pi**2)

regularization

“L2” or “L1”. Default is “L2”

lambdaN

LambdaN parameter for L2 regularization. (default=1e-8)

lambdaL

LambdaL parameter for L2 regularization. (default=1e-8)

regularization_weighting: int or “CV”

L1 regualrization weighting. Default “CV” (use cross-validation). Can specify a static value to use in all voxels.

l1_positive_constraint: bool

Use positivity constraint.

l1_maxiter

Maximum number of iterations for L1 optization. (Default=1000)

l1_alpha

Alpha parameter for L1 optimization. (default=1.0)

pos_grid: int

Grid points for estimating EAP(default=11)

pos_radius

Radius for EAP estimation (default=20e-03)

qsirecon.workflows.recon.dipy.init_dipy_mapmri_recon_wf(inputs_dict, name='dipy_mapmri_recon', qsirecon_suffix='', params={})[source]

Reconstruct EAPs, ODFs, using 3dSHORE (brainsuite-style basis set).

Inputs

qsirecon outputs

Outputs

shore_coeffs

3dSHORE coefficients

rtop

Voxelwise Return-to-origin probability.

rtap

Voxelwise Return-to-axis probability.

rtpp

Voxelwise Return-to-plane probability.

msd

Voxelwise MSD

qiv

q-space inverse variance

lapnorm

Voxelwise norm of the Laplacian

Params

write_fibgz: bool

True writes out a DSI Studio fib file

write_mif: bool

True writes out a MRTrix mif file with sh coefficients

radial_order: int

An even integer that represent the order of the basis

laplacian_regularization: bool

Regularize using the Laplacian of the MAP-MRI basis.

laplacian_weighting: str or scalar

The string ‘GCV’ makes it use generalized cross-validation to find the regularization weight. A scalar sets the regularization weight to that value and an array will make it selected the optimal weight from the values in the array.

positivity_constraint: bool

Constrain the propagator to be positive.

pos_grid: int

Grid points for estimating EAP(default=15)

pos_radius

Radius for EAP estimation (default=20e-03) or “adaptive”

anisotropic_scalingbool,

If True, uses the standard anisotropic MAP-MRI basis. If False, uses the isotropic MAP-MRI basis (equal to 3D-SHORE).

eigenvalue_thresholdfloat,

Sets the minimum of the tensor eigenvalues in order to avoid stability problem.

bval_thresholdfloat,

Sets the b-value threshold to be used in the scale factor estimation. In order for the estimated non-Gaussianity to have meaning this value should set to a lower value (b<2000 s/mm^2) such that the scale factors are estimated on signal points that reasonably represent the spins at Gaussian diffusion.

dti_scale_estimationbool,

Whether or not DTI fitting is used to estimate the isotropic scale factor for isotropic MAP-MRI. When set to False the algorithm presets the isotropic tissue diffusivity to static_diffusivity. This vastly increases fitting speed but at the cost of slightly reduced fitting quality. Can still be used in combination with regularization and constraints.

static_diffusivityfloat,

the tissue diffusivity that is used when dti_scale_estimation is set to False. The default is that of typical white matter D=0.7e-3 _[5].

cvxpy_solverstr, optional

cvxpy solver name. Optionally optimize the positivity constraint with a particular cvxpy solver. See http://www.cvxpy.org/ for details. Default: None (cvxpy chooses its own solver)

qsirecon.workflows.recon.dipy.init_dipy_dki_recon_wf(inputs_dict, name='dipy_dki_recon', qsirecon_suffix='', params={})[source]

Fit DKI.

This workflow corresponds to the “DKI_reconstruction” pipeline action.

Parameters:
  • inputs_dict (dict) – Dictionary containing the input node fields.

  • name (str) – Name of the workflow.

  • qsirecon_suffix (str) – Suffix for the qsirecon outputs.

  • params (dict) – Dictionary containing the parameters for the workflow. Parameters that can be passed to the workflow are:

    • wmtibool

      Whether to compute microstructural metrics.

    • write_fibgzbool

      Whether to write out a DSI Studio fib file.

    • write_mifbool

      Whether to write out a MRTrix mif file with sh coefficients.

    • radial_orderint

      An even integer that represents the order of the basis.

Outputs:
  • tensor (str) – Path to the tensor file.

  • fa (str) – Path to the FA file.

  • md (str) – Path to the MD file.

  • rd (str) – Path to the RD file.

  • ad (str) – Path to the AD file.

  • color_fa (str) – Path to the color FA file.

  • kfa (str) – Path to the KFA file.

  • mk (str) – Path to the MK file.

  • ak (str) – Path to the AK file.

  • rk (str) – Path to the RK file.

  • mkt (str) – Path to the MKT file.

  • awf (str) – Only if wmti is True

  • rde (str) – Only if wmti is True

  • tortuosity (str) – Only if wmti is True

  • trace (str) – Only if wmti is True

  • recon_scalars (str) – Path to the recon_scalars file.

qsirecon.workflows.recon.dipy.external_format_datasinks(qsirecon_suffix, params, wf)[source]

Add datasinks for Dipy Reconstructions in other formats.

qsirecon.workflows.recon.dipy.infer_deltas(metadata, params)[source]

Infer deltas from available information.

qsirecon.workflows.recon.dipy.init_dipy_brainsuite_shore_recon_wf(inputs_dict, name='dipy_3dshore_recon', qsirecon_suffix='', params={})[source]

Reconstruct EAPs, ODFs, using 3dSHORE (brainsuite-style basis set).

Inputs

qsirecon outputs

Outputs

shore_coeffs

3dSHORE coefficients

rtop

Voxelwise Return-to-origin probability.

rtap

Voxelwise Return-to-axis probability.

rtpp

Voxelwise Return-to-plane probability.

Params

write_fibgz: bool

True writes out a DSI Studio fib file

write_mif: bool

True writes out a MRTrix mif file with sh coefficients

convert_to_multishell: str

either “HCP”, “ABCD”, “lifespan” will resample the data with this scheme

radial_order: int

Radial order for spherical harmonics (even)

zeta: float

Zeta parameter for basis set.

tau:float

Diffusion parameter (default= 4 * np.pi**2)

regularization

“L2” or “L1”. Default is “L2”

lambdaN

LambdaN parameter for L2 regularization. (default=1e-8)

lambdaL

LambdaL parameter for L2 regularization. (default=1e-8)

regularization_weighting: int or “CV”

L1 regualrization weighting. Default “CV” (use cross-validation). Can specify a static value to use in all voxels.

l1_positive_constraint: bool

Use positivity constraint.

l1_maxiter

Maximum number of iterations for L1 optization. (Default=1000)

l1_alpha

Alpha parameter for L1 optimization. (default=1.0)

pos_grid: int

Grid points for estimating EAP(default=11)

pos_radius

Radius for EAP estimation (default=20e-03)

qsirecon.workflows.recon.dipy.init_dipy_dki_recon_wf(inputs_dict, name='dipy_dki_recon', qsirecon_suffix='', params={})[source]

Fit DKI.

This workflow corresponds to the “DKI_reconstruction” pipeline action.

Parameters:
  • inputs_dict (dict) – Dictionary containing the input node fields.

  • name (str) – Name of the workflow.

  • qsirecon_suffix (str) – Suffix for the qsirecon outputs.

  • params (dict) – Dictionary containing the parameters for the workflow. Parameters that can be passed to the workflow are:

    • wmtibool

      Whether to compute microstructural metrics.

    • write_fibgzbool

      Whether to write out a DSI Studio fib file.

    • write_mifbool

      Whether to write out a MRTrix mif file with sh coefficients.

    • radial_orderint

      An even integer that represents the order of the basis.

Outputs:
  • tensor (str) – Path to the tensor file.

  • fa (str) – Path to the FA file.

  • md (str) – Path to the MD file.

  • rd (str) – Path to the RD file.

  • ad (str) – Path to the AD file.

  • color_fa (str) – Path to the color FA file.

  • kfa (str) – Path to the KFA file.

  • mk (str) – Path to the MK file.

  • ak (str) – Path to the AK file.

  • rk (str) – Path to the RK file.

  • mkt (str) – Path to the MKT file.

  • awf (str) – Only if wmti is True

  • rde (str) – Only if wmti is True

  • tortuosity (str) – Only if wmti is True

  • trace (str) – Only if wmti is True

  • recon_scalars (str) – Path to the recon_scalars file.

qsirecon.workflows.recon.dipy.init_dipy_mapmri_recon_wf(inputs_dict, name='dipy_mapmri_recon', qsirecon_suffix='', params={})[source]

Reconstruct EAPs, ODFs, using 3dSHORE (brainsuite-style basis set).

Inputs

qsirecon outputs

Outputs

shore_coeffs

3dSHORE coefficients

rtop

Voxelwise Return-to-origin probability.

rtap

Voxelwise Return-to-axis probability.

rtpp

Voxelwise Return-to-plane probability.

msd

Voxelwise MSD

qiv

q-space inverse variance

lapnorm

Voxelwise norm of the Laplacian

Params

write_fibgz: bool

True writes out a DSI Studio fib file

write_mif: bool

True writes out a MRTrix mif file with sh coefficients

radial_order: int

An even integer that represent the order of the basis

laplacian_regularization: bool

Regularize using the Laplacian of the MAP-MRI basis.

laplacian_weighting: str or scalar

The string ‘GCV’ makes it use generalized cross-validation to find the regularization weight. A scalar sets the regularization weight to that value and an array will make it selected the optimal weight from the values in the array.

positivity_constraint: bool

Constrain the propagator to be positive.

pos_grid: int

Grid points for estimating EAP(default=15)

pos_radius

Radius for EAP estimation (default=20e-03) or “adaptive”

anisotropic_scalingbool,

If True, uses the standard anisotropic MAP-MRI basis. If False, uses the isotropic MAP-MRI basis (equal to 3D-SHORE).

eigenvalue_thresholdfloat,

Sets the minimum of the tensor eigenvalues in order to avoid stability problem.

bval_thresholdfloat,

Sets the b-value threshold to be used in the scale factor estimation. In order for the estimated non-Gaussianity to have meaning this value should set to a lower value (b<2000 s/mm^2) such that the scale factors are estimated on signal points that reasonably represent the spins at Gaussian diffusion.

dti_scale_estimationbool,

Whether or not DTI fitting is used to estimate the isotropic scale factor for isotropic MAP-MRI. When set to False the algorithm presets the isotropic tissue diffusivity to static_diffusivity. This vastly increases fitting speed but at the cost of slightly reduced fitting quality. Can still be used in combination with regularization and constraints.

static_diffusivityfloat,

the tissue diffusivity that is used when dti_scale_estimation is set to False. The default is that of typical white matter D=0.7e-3 _[5].

cvxpy_solverstr, optional

cvxpy solver name. Optionally optimize the positivity constraint with a particular cvxpy solver. See http://www.cvxpy.org/ for details. Default: None (cvxpy chooses its own solver)