Skip to content

About

A neural field for adaptive white matter fiber modeling from diffusion MRI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FiberField

fixel visualization

A neural field for adaptive white matter fiber modeling from diffusion MRI.

Usage

After cloning this repository, you can install the package in a virtual environment. Alternatively, you can run commands directly using uv run.

The main command is fiberfield, which can be used to train and run inference on diffusion MRI. See fiberfield --help for an explanation of the command line arguments.

For example, to train and run inference using the default settings for the multi-stick model used in [1]:

uv run fiberfield \
    --input "dwi.nii.gz" \
    --bval "dwi.bval" \
    --bvec "dwi.bvec" \
    --mask "mask.nii.gz" \
    --output_dir "fiberfield-stick" \
    --model stick \
    --device cuda:0

To estimate the full Standard Model parameters as in [2], use:

uv run fiberfield \
    --input "dwi.nii.gz" \
    --bval "dwi.bval" \
    --bvec "dwi.bvec" \
    --mask "mask.nii.gz" \
    --output_dir "fiberfield-sm" \
    --model sm_two_stage \
    --device cuda:0

The outputs will be in a sparse format in the output directory (e.g., D_intra.nii.gz will be i x j x k x n where n is the maximum number of fibers). They will also be stored in MRtrix3 fixel format.

To visualize the outputs, you can use the fixel visualization tool provided in MRtrix3's mrview. Alternatively, we provide a fixel visualization tool called fixelview. For example, to visualize the intra-axonal volume fraction:

uv run fixelview \  
    "fiberfield-stick/fixel" \
    mask.nii.gz \
    --fixel_data D_intra.nii.gz \
    --fixel_cmap "cmc.batlow" \
    --fixel_value_range 0.0 3e-3

To visualize just the directions, do not provide a --fixel_data argument. You can also save the visualization to a file using the --save_path argument.

If you want to match a set of fixels to a reference set, you can use the fixelmatch command.

Container

For reproducibility, we also provide a containerized version at https://doi.org/10.5281/zenodo.23674818. You can build the container as a Docker image using the provided Dockerfile. Or, you can download the pre-built Apptainer image. The usage is similar to above:

apptainer run \
    -B /path/to/data:/path/to/data \
    --nv \
    fiberfield_v0.2.0.sif \
    fiberfield \
    --input "/path/to/data/dwi.nii.gz" \
    ...

Note that when using the containerized version, the interactive version of fixelview will not work. You must use --save_path and save the visualization to a file.

References

If you use this code in your research, please see the following papers:

[1] Adam M. Saunders, Gaurav Rudravaram, Elyssa M. McMaster, Michael E. Kim, Trent Schwartz, Yimeng Dou, Yihao Liu, Lianrui Zuo, Adam W. Anderson, and Bennett A. Landman. "Neural fields for adaptive white matter microstructural modeling." Accepted to SPIE Medical Imaging: Image Processing, 2027.

[2] Adam M. Saunders, Gaurav Rudravaram, Elyssa M. McMaster, Michael E. Kim, Trent Schwartz, Yimeng Dou, Lianrui Zuo, Adam W. Anderson, Bennett A. Landman. "FiberField: Adaptive information theory-guided neural fields for white matter microstructure." In preparation.

About

A neural field for adaptive white matter fiber modeling from diffusion MRI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages