src.original.fitting.PV_MUMC package

Submodules

src.original.fitting.PV_MUMC.triexp_fitting_algorithms module

January 2022 by Paulien Voorter p.voorter@maastrichtuniversity.nl https://www.github.com/paulienvoorter

Code is uploaded as part of the publication: Voorter et al. MRM DOI:10.1002/mrm.29753 (2023)

requirements: numpy tqdm scipy joblib

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.correct_for_IR(ampl_Dpar, ampl_Dint, ampl_Dmv)[source]

This function corrects for the inversion recovery in the IVIM sequence, as described in Wong et al. (2019) Spectral Diffusion analysis of intravoxel incoherent motion MRI in cerebral small vessel disease :param ampl_Dpar: Scalar, the sum of amplitudes within the Dpar range :param ampl_Dint: Scalar, the sum of amplitudes within the Dint range :param ampl_Dmv: Scalar, the sum of amplitudes within the Dmv range :return corr_Fpar: Scalar, the fraction of Dpar, corrected for inversion recovery :return corr_Fint: Scalar, the fraction of Dint, corrected for inversion recovery :return corr_Fmv: Scalar, the fraction of Dmv, corrected for inversion recovery

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.fit_NNLS(bvalues, dw_data, IR=False, bounds=([0.9, 0.0001, 0.0, 0.0015, 0.0, 0.004], [1.1, 0.0015, 0.4, 0.004, 0.2, 0.2]))[source]

This is an implementation of the tri-exponential fit. It fits a single curve with the non-negative least squares (NNLS) fitting approach, see 10.1002/jmri.26920. :param bvalues: 1D Array with the b-values :param dw_data: 2D Array with diffusion-weighted signal in different voxels at different b-values :param IR: Boolean; True will fit the IVIM accounting for inversion recovery, False will fit IVIM without IR correction. default = True :param bounds: Array with fit bounds ([fp0min, Dparmin, Fintmin, Dintmin, Fmvmin, Dmvmin],[fp0max, Dparmax, Fintmax, Dintmax, Fmvmax, Dmvmax]). Default: ([0, 0, 0, 0.005, 0, 0.06], [2.5, 0.005, 1, 0.06, 1, 0.5]) :return Fp0: optional 1D Array with f0 in each voxel :return Dpar: 1D Array with Dpar in each voxel :return Fint: 1D Array with Fint in each voxel :return Dint: 1D Array with Dint in each voxel :return Fmv: 1D Array with the fraciton of signal for Dmv in each voxel :return Dmv: 1D Array with Dmv in each voxel

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.fit_least_squares_tri_exp(bvalues, dw_data, IR=False, S0_output=False, fitS0=False, bounds=([0.9, 0.0001, 0.0, 0.0015, 0.0, 0.004], [1.1, 0.0015, 0.4, 0.004, 0.2, 0.2]), cutoff=200)[source]

This is the LSQ implementation for a tri-exp model, in which we first estimate Dpar using a curve fit to b-values>=cutoff; Second, we fit the other parameters using all b-values, while setting Dpar from step 1 as upper bound and starting value. It fits a single curve :param bvalues: 1D Array with the b-values :param dw_data: 1D Array with diffusion-weighted signal in different voxels at different b-values :param IR: Boolean; True will fit the IVIM accounting for inversion recovery, False will fit IVIM without IR; default = True :param S0_output: Boolean determining whether to output (often a dummy) variable S0; default = False :param fix_S0: Boolean determining whether to fix S0 to 1; default = True :param bounds: Array with fit bounds ([S0min, Dparmin, Fintmin, Dintmin, Fmvmin, Dmvmin],[S0max, Dparmax, Fintmax, Dintmax, Fmvmax, Dmvmax]). Default: ([0, 0, 0, 0.005, 0, 0.06], [2.5, 0.005, 1, 0.06, 1, 0.5]) :param cutoff: cutoff b-value used in step 1 :return S0: optional 1D Array with S0 in each voxel :return Dpar: scalar with Dpar of the specific voxel :return Fint: scalar with Fint of the specific voxel :return Dint: scalar with Dint of the specific voxel :return Fmv: scalar with Fmv of the specific voxel :return Dmv: scalar with Dmv of the specific voxel

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.tri_expN(bvalues, S0, Dpar, Fint, Dint, Fmv, Dmv)[source]

tri-exponential IVIM function

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.tri_expN_IR(bvalues, S0, Dpar, Fint, Dint, Fmv, Dmv)[source]

tri-exponential IVIM function accounted for inversion recovery (IR)

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.tri_expN_noS0(bvalues, Dpar, Fint, Dint, Fmv, Dmv)[source]

tri-exponential IVIM function, and S0 set to 1

src.original.fitting.PV_MUMC.triexp_fitting_algorithms.tri_expN_noS0_IR(bvalues, Dpar, Fint, Dint, Fmv, Dmv)[source]

tri-exponential IVIM function accounted for inversion recovery (IR), and S0 set to 1

src.original.fitting.PV_MUMC.two_step_IVIM_fit module

January 2022 by Paulien Voorter p.voorter@maastrichtuniversity.nl https://www.github.com/paulienvoorter

requirements: numpy tqdm scipy

src.original.fitting.PV_MUMC.two_step_IVIM_fit.fit_least_squares(bvalues, dw_data, S0_output=False, fitS0=False, bounds=([0.9, 0.0001, 0.0, 0.0025], [1.1, 0.003, 1, 0.2]), cutoff=200)[source]

This is the LSQ implementation, in which we first estimate Dpar using a curve fit to b-values>=cutoff; Second, we fit the other parameters using all b-values, while fixing Dpar from step 1. This fit is done on an array. It fits a single curve

param bvalues:

1D Array with the b-values

param dw_data:

1D Array with diffusion-weighted signal in different voxels at different b-values

param S0_output:

Boolean determining whether to output (often a dummy) variable S0;

param fitS0:

Boolean determining whether to fix S0 to 1;

param bounds:

Array with fit bounds ([S0min, Dparmin, Fmvmin, Dmvmin],[S0max, Dparmax, Fmvmax, Dmvmax]).

param cutoff:

cutoff b-value used in step 1

return S0:

optional 1D Array with S0 in each voxel

return Dpar:

scalar with Dpar of the specific voxel

return Fmv:

scalar with Fmv of the specific voxel

return Dmv:

scalar with Dmv of the specific voxel

src.original.fitting.PV_MUMC.two_step_IVIM_fit.fit_least_squares_array(bvalues, dw_data, fitS0=False, bounds=([0.9, 0.0001, 0.0, 0.0025], [1.1, 0.0025, 0.5, 0.2]), cutoff=200)[source]

This is the LSQ implementation, in which we first estimate Dpar using a curve fit to b-values>=cutoff; Second, we fit the other parameters using all b-values, while fixing Dpar from step 1. This fit is done on an array. :param bvalues: 1D Array with the b-values :param dw_data: 2D Array with diffusion-weighted signal in different voxels at different b-values :param bounds: Array with fit bounds ([S0min, Dparmin, Fmvmin, Dmvmin],[S0max, Dparmax, Fmvmax, Dmvmax]). :param cutoff: cutoff b-value used in step 1 :return Dpar: 1D Array with Dpar in each voxel :return Fmv: 1D Array with Fmv in each voxel :return Dmv: 1D Array with Dmv in each voxel :return S0: 1D Array with S0 in each voxel

src.original.fitting.PV_MUMC.two_step_IVIM_fit.two_exp(bvalues, S0, Dpar, Fmv, Dmv)[source]

bi-exponential IVIM function

src.original.fitting.PV_MUMC.two_step_IVIM_fit.two_exp_noS0(bvalues, Dpar, Fmv, Dmv)[source]

bi-exponential IVIM function, and S0 set to 1

Module contents