Implements free water elimination (FWE) models for preprocessing diffusion MRI data.
@article{10.1162/IMAG.a.991,
author = {Chang, Kelly and Burke, Luke and LaPiana, Nina and Howlett, Bradley and Hunt, David and Dezelar, Margaret and Andre, Jalal B. and Curl, Patti and Ralston, James D. and Rokem, Ariel and Mac Donald, Christine L.},
title = {Free water elimination tractometry for aging brains},
journal = {Imaging Neuroscience},
volume = {3},
pages = {IMAG.a.991},
year = {2025},
month = {11},
url = {https://doi.org/10.1162/IMAG.a.991}
}
$ git clone https://github.com/nrdg/fwe
$ cd fwe
$ pip install .The software depends on DIPY, which is installed automatically as part of the installation process specified above.
- Free water DTI as implmented in
dipy(Hoy et al., 2014): Usefwe_model="dipy_fwdti" - Beltrami regularized gradient descent free water DTI (Golub et al., 2020): Use
fwe_model="golub_beltrami"
The software expects as input data that has already been preprocessed (we use qsiprep).
If the data has multiple non-zero b-values, it is preferable to use the
'dipy_fwdti' model. If the data has one non-zero b-value, only the
'golub_beltrami' model can be used.
The following is a complete example, using a subject from the HBN POD2 dataset.
To run this example, you will also need the boto3 software library (pip install boto3), which will download the data.
from dipy.data.fetcher import fetch_hbn, dipy_home
import os.path as op
from fwe import free_water_elimination
fetch_hbn(["NDARAA948VFH"])
dwi_folder = op.join(dipy_home, "HBN/derivatives/qsiprep/sub-NDARAA948VFH/ses-HBNsiteRU/dwi/")
data_root = op.join(dwi_folder, "sub-NDARAA948VFH_ses-HBNsiteRU_acq-64dir_space-T1w_desc-preproc_dwi")
free_water_elimination(
dwi_fname = data_root + ".nii.gz",
bval_fname = data_root + ".bval",
bvec_fname = data_root + ".bvec",
mask_fname = op.join(dwi_folder, "sub-NDARAA948VFH_ses-HBNsiteRU_acq-64dir_space-T1w_desc-brain_mask.nii.gz"),
fwe_model = "dipy_fwdti",
output_fname = "sub-01_fwe.nii.gz"
)