Skip to main content

Gray Matter Swiss Knife : Generalized Exchange Model estimators for diffusion MRI

Project description

Gray Matter Microstructure models estimator for gray matter diffusion MRI

PyPI - Version PyPI - Downloads GitHub GitHub top language PyPI - Python Version Code style: black


Table of Contents

Installation

pip install graymatter_swissknife

Usage

Estimate Gray Matter microstructure model parameters

To estimate any gray matter model parameters with Nonlinear Least Squares using the graymatter_swissknife package, you can use the estimate_model function. This function takes several parameters that you need to provide in order to perform the estimation accurately.

estimate_model(model_name, dwi_path, bvals_path, td_path, small_delta, lowb_noisemap_path, out_path)

model_name: Choose your gray matter model between 'Nexi' (or 'Nexi_Narrow_Pulses_Approximation'), 'Smex' (or 'Nexi_Wide_Pulses'), 'Sandi', 'Sandix' and 'Gem'.

dwi_path: The path to the diffusion-weighted image (DWI) data in NIfTI format. This data contains the preprocessed diffusion-weighted volumes acquired from your imaging study.

bvals_path: The path to the b-values file corresponding to the DWI data, in ms/µm². B-values specify the strength and timing of diffusion sensitization gradients for each volume in the DWI data.

td_path: The path to the diffusion time (td) / Δ file, in ms. This file provides information about Δ for each volume in the DWI data. Δ is the time at the beginning of the second gradient pulse.

small_delta (float): The value of δ in your protocol, in ms. δ is the duration of a gradient pulse. A future update will allow multiple δ in the protocol.

lowb_noisemap_path: The path to the noisemap calculated using only the small b-values (b < 2 ms/µm²) and Marchenko-Pastur principal component analysis (MP-PCA) denoising. This noisemap is used to calculate the signal-to-noise ratio (SNR) of the data.

out_path: The folder where the estimated parameters will be saved as output.

Additional options:

mask_path: The mask path, if the analysis concerns a specific portion of the DWI images. The mask can be in 3 dimensions, or must be able to be squeezed in only 3 dimensions.

fixed_parameters: Allows to fix some parameters of the model if not set to None. Tuple of fixed parameters for the model. The tuple must have the same length as the number of parameters of the model (without noise correction). Example of use: Fix Di to 2.0µm²/ms and De to 1.0µm²/ms in the NEXI model by specifying fixed_parameters=(None, 2.0 , 1.0, None)

n_cores: Number of cores to use for the parallelization. If -1, all available cores are used. The default is -1.

debug: Debug mode. The default is False.

Gray Matter microstructure models description from the Generalized Exchange Model

Prerequisites

Data Acquisition

For accurate parameter estimation using the graymatter_swissknife package, acquire PGSE EPI (Pulsed Gradient Spin Echo Echo-Planar Imaging) diffusion MRI data with diverse combinations of b values and diffusion times. Ensure reasonable signal-to-noise ratio (SNR) in the data for accurate parameter estimation.

Preprocessing

Before proceeding, make sure to preprocess your data with the following steps:

Additionally, you need to compute another noisemap using only the small b-values (b < 2 ms/µm²) and MP-PCA. This noisemap will be used to calculate the signal-to-noise ratio (SNR) of the data.

Furthermore, you can provide a mask of grey matter tissue if available. This mask can be used to restrict the processing to specific regions of interest. If a mask is not provided, the algorithms will be applied to the entire image, voxel by voxel, as long as there are no NaN values present.

To compute a grey matter mask, one common approach involves using a T1 image, FastSurfer, and performing registration to the diffusion (b = 0 ms/µm²) space. However, you can choose any other method to compute a grey matter mask.

Citation

If you use this package in your research, please consider citing the following papers:

Original gray matter model papers

Generalized Exchange Model ($GEM$) / Development of this package

Quentin Uhl, Tommaso Pavan, Inès de Riedmatten, Jasmine Nguyen-Duc, and Ileana Jelescu, GEM: a unifying model for Gray Matter microstructure, Proc. Intl. Soc. Mag. Reson. Med. 2024. Presented at the Annual Meeting of the ISMRM, Singapore, Singapore, p. 7970.

Neurite Exchange Imaging ($NEXI$, or $NEXI_{Narrow Pulse Approximation}$)

Ileana O. Jelescu, Alexandre de Skowronski, Françoise Geffroy, Marco Palombo, Dmitry S. Novikov, Neurite Exchange Imaging (NEXI): A minimal model of diffusion in gray matter with inter-compartment water exchange, NeuroImage, 2022.

Standard Model with Exchange ($SMEX$, or $NEXI_{Wide Pulses}$)

Jonas L. Olesen, Leif Østergaard, Noam Shemesh, Sune N. Jespersen, Diffusion time dependence, power-law scaling, and exchange in gray matter, NeuroImage, 2022.

Soma And Neurite Density Imaging ($SANDI$)

Marco Palombo, Andrada Ianus, Michele Guerreri, Daniel Nunes, Daniel C. Alexander, Noam Shemesh, Hui Zhang, SANDI: A compartment-based model for non-invasive apparent soma and neurite imaging by diffusion MRI, NeuroImage, 2020.

Soma And Neurite Density Imaging with eXchange ($SANDIX$)

Jonas L. Olesen, Leif Østergaard, Noam Shemesh, Sune N. Jespersen, Diffusion time dependence, power-law scaling, and exchange in gray matter, NeuroImage, 2022.

License

graymatter_swissknife is distributed under the terms of the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graymatter_swissknife-1.0.0.tar.gz (129.5 kB view details)

Uploaded Source

Built Distribution

graymatter_swissknife-1.0.0-py3-none-any.whl (67.1 kB view details)

Uploaded Python 3

File details

Details for the file graymatter_swissknife-1.0.0.tar.gz.

File metadata

File hashes

Hashes for graymatter_swissknife-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11b3146650eb1a8486e0a759b3b470afc8a37aaeac90377d873f5176403b7ce7
MD5 473bda6e2c7f7c58aad801092d7f4bcb
BLAKE2b-256 702a4c3d237f2159d4b40f20efca8e5ec30a67b967967d3c51fb233059688fc4

See more details on using hashes here.

Provenance

File details

Details for the file graymatter_swissknife-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for graymatter_swissknife-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f60a71177789b0b1f243d768489f8c38a379088b3b28294435a2606beaf06812
MD5 522a178f194d05353960529a68d1b38b
BLAKE2b-256 aa55ab60e489181226cb537b163402017bfcb701dc632afd20e87f6e5be4fb84

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page