dipy_fit module¶
Wrapper that uses DIPY to fit DTI and DKI representations.
-
dipy_fit.
fit_dki
(dwi, blur=False)¶ Fit a DKI model to a DWI, applying a mask if provided.
Parameters: - dwi (DiffusionWeightedImage) – DWI data to fit to the model.
- blur (bool, optional) – True if the image should be blurred before the model fit.
Returns: dwifit – A fit from which parameter maps can be generated
Return type: DiffusionKurtosisFit
-
dipy_fit.
fit_dti
(dwi)¶ Fit a DTI model to a DWI, applying a mask if provided.
Parameters: - dwi (DiffusionWeightedImage) – DWI data to fit to the model.
- blur (bool, optional) – True if the image should be blurred before the model fit.
Returns: dwifit – A fit from which parameter maps can be generated
Return type: TensorFit
-
dipy_fit.
main
(nifti_path, bval_path, bvec_path, mask_path=None, blur=False, fa_path=None, md_path=None, ad_path=None, rd_path=None, mk_path=None, ak_path=None, rk_path=None)¶ Load and fit an image to a DKI model, then save its parameters.
This is meant to deal with the functionality of this module being called as a script.
Parameters: - nifti_path (str) – Path to the nifti DWI
- bval_path (str) – Path to the .bval file
- bvec_path (str) – Path to the .bvec file
- mask_path (str, optional) – Path to the nifti mask, if one exists
- fa_path (str, optional) – Path to which the fractional anisotropy image should be saved
- md_path (str, optional) – Path to which the mean diffusivity image should be saved
- ad_path (str, optional) – Path to which the axial diffusivity image should be saved
- rd_path (str, optional) – Path to which the radial diffusivity image should be saved
- mk_path (str, optional) – Path to which the mean kurtosis image should be saved
- ak_path (str, optional) – Path to which the axial kurtosis image should be saved
- rk_path (str, optional) – Path to which the radial kurtosis image should be saved
-
dipy_fit.
save_dki_metric_imgs
(dwi, dkifit, fa_path=None, md_path=None, ad_path=None, rd_path=None, mk_path=None, ak_path=None, rk_path=None)¶ Save DTI metric images as NIFTI files.
Parameters: - dwi (DiffusionWeightedImage) – The source image from which the DTI metrics are derived.
- dkifit (DiffusionKurtosisFit) – The fit data from the DKI.
- md_path, ad_path, rd_path (fa_path,) – The filepaths to which each DTI metric image should be saved.
- ak_path, rk_path (mk_path,) – The filepaths to which each DKI metric image should be saved.
-
dipy_fit.
save_dti_metric_imgs
(dwi, dtifit, fa_path=None, md_path=None, ad_path=None, rd_path=None)¶ Save DTI metric images as NIFTI files.
Parameters: - dwi (DiffusionWeightedImage) – The source image from which the DTI metrics are derived.
- dtifit (TensorFit) – The fit data from the DTI.
- md_path, ad_path, rd_path (fa_path,) – The filepath to which each metric image should be saved.