IQMs for diffusion images
Image quality metrics for diffusion MRI data
The names below are the columns of the group table (group_dwi.tsv).
Volumes with a b-value of 50 or lower are considered b=0, and shells are sorted by
increasing b-value.
The efc_shell* and fber_shell* columns count the b=0 volumes as their first
shell (shell01), whereas the snr_cc_shell* columns number b=0 as shell0
and the diffusion-weighted shells from shell1 on.
Shell descriptors
- Number of shells and b-values (
NumberOfShells,bValues,bValuesEstimation) NumberOfShellsis the number of diffusion-weighted shells (b=0 excluded), andbValuesEstimationlists the b-value of each of them.bValueslists the unique b-values in the.bvalfile, or readsLikely DSIwhen there are more than ten. Data with more than eleven distinct nonzero b-values (rounded to hundreds) are considered DSI, and their b-values are clustered into shells with k-means.
IQMs relating to spatial information
Definitions are given in the summary of structural IQMs.
Entropy-focus criterion (
efc_shell*,efc()), calculated on each shell after head-motion correction.
Foreground-Background energy ratio (
fber_shell*,fber(), [Shehzad2015]), calculated on each shell after head-motion correction, with the brain mask as foreground.
Summary statistics (
summary_{bg,fg,wm}_*,summary_stats()) of the average b=0 image within the background (bg), the brain mask (fg), and a white-matter mask (wm, the largest connected component of FA above 0.35). For each region, MRIQC reports the mean, the median, the standard deviation (stdv), the median absolute deviation (mad), the kurtosis (k), the 5th and 95th percentiles (p05,p95), and the number of voxels (n).
IQMs relating to diffusion weighting
IQMs specific to diffusion weighted imaging.
- SNR estimated in the Corpus Callosum (
snr_cc_*,cc_snr()) The corpus callosum (CC) mask gathers the white-matter voxels, within a central bounding box, whose color FA is predominantly red (left-right orientation).
snr_cc_shell0is the mean of the average b=0 image within the CC, divided bysigma_cc. For each diffusion-weighted shell,snr_cc_shell<N>_worsttakes the volume whose b-vector is closest to the left-right (X) axis, where diffusion along the callosal fibers attenuates the signal the most, andsnr_cc_shell<N>_bestaverages the volumes closest to the Y and Z axes. Both are the mean signal within the CC divided bysigma_cc.
- Signal variability in the Corpus Callosum (
sigma_cc) Robust standard deviation (normalized median absolute deviation) of the average b=0 image within the CC mask, used as the noise term of
snr_cc_*.
- Noise level estimated by PCA denoising (
sigma_pca) Median, within the brain mask, of the noise-level map that svht_denoise estimates while denoising the series (singular value shrinkage on local patches).
- Noise in raw dMRI estimated with PIESNO (
sigma_piesno) Employs the PIESNO (Probabilistic Identification and Estimation of Noise) algorithm [Koay2009] to estimate the standard deviation (sigma) of the noise in each slice of the input 4D dMRI series, assuming four receiver channels. MRIQC reports the median across slices.
- Number of not-a-number (NaN) values in the FA map (
fa_nans) Fraction of NaNs within the brain mask, in ppm. The FA map comes from a tensor (single-shell) or a kurtosis (multi-shell) model fitted on the denoised data.
- Number of degenerate modeled voxels in the FA map (
fa_degenerate) Fraction of invalid FA values (i.e., outside the [0, 1] closed range) within the brain mask, in ppm.
- Neighboring DWI correlation (
ndc,neighboring_dwi_correlation()) Average Pearson correlation, within the brain mask, between each diffusion-weighted volume of the input series and its nearest neighbor in q-space [Yeh2019]. Low values (typically below 0.4) can indicate poor image quality.
IQMs relating artifacts and other
IQMs targeting artifacts that are specific of DWI images.
- Global and slice-wise spike fractions (
spikes_*,spike_ppm()) Fractions of voxels classified as spikes (in parts-per-million, ppm). A voxel is a spike when its intensity exceeds the mean plus three standard deviations of the brain voxels in its shell.
spikes_globalis the fraction of spiking voxels across the input series. For each axis,spikes_slice_{i,j,k}is the fraction of rows of voxels along that axis (one row per position on the other two axes and volume) where more than 5% of the voxels are spikes.
- Head motion (
fd_*) Framewise displacement (FD) estimated by the head-motion correction, which aligns every volume to the average b=0 image with AFNI’s
3dvolreg.fd_meanis the average FD (in mm),fd_numthe number of volumes with an FD above 0.2 mm, andfd_perctheir percentage over the series.
- Rotation of the b-vectors by head motion (
bdiffs_*) Angle (in radians) between each original b-vector and the same vector rotated by the head-motion correction.
bdiffs_mean,bdiffs_median,bdiffs_min, andbdiffs_maxsummarize the volumes rotated by more than 1e-4 rad (b=0 volumes are therefore excluded).
Not reported
Smoothness (fwhm_*) is not computed on DWI data, and
noise_b0() is not used by the DWI workflow.
References
Koay C.G., E. Ozarslan, C. Pierpaoli. Probabilistic Identification and Estimation of Noise (PIESNO): A self-consistent approach and its applications in MRI. JMR, 199(1):94-103, 2009.
- exception mriqc.qc.diffusion.ExtremeValueWarning[source]
Bases:
UserWarningA warning type for dubious metric values.
- mriqc.qc.diffusion.cc_snr(in_b0: ndarray, dwi_shells: list[ndarray], cc_mask: ndarray, b_values: ndarray, b_vectors: ndarray, bval_thres: int = 50, decimals: int = 2) dict[int, (<class 'float'>, <class 'float'>)][source]
Calculates the worst-case and best-case signal-to-noise ratio (SNR) within the corpus callosum.
This function estimates the SNR in the corpus callosum (CC) by comparing the mean signal intensity within the CC mask to the standard deviation of the background signal (extracted from the b0 image). It performs separate calculations for each diffusion-weighted imaging (DWI) shell.
Worst-case SNR: The mean signal intensity along the diffusion direction with the lowest signal is considered the worst-case scenario.
Best-case SNR: The mean signal intensity averaged across the two diffusion directions with the highest signal is considered the best-case scenario.
- Parameters:
in_b0 (
ndarray(float, 3D)) – T1-weighted or b0 image used for background signal estimation.dwi_shells (list[
ndarray(float, 4D)]) – List of DWI data for each diffusion-weighted shell (excluding b=0).cc_mask (
ndarray(bool, 3D)) – Boolean mask of the corpus callosum.b_values (
ndarray(int)) – Array of b-values, one per shell indwi_shells.b_vectors (
ndarray(float)) – Array of diffusion-encoding vectors for each DWI volume indwi_shells.
- Returns:
cc_snr_estimates – Dictionary containing SNR estimates for each b-value. Keys are the b-values (integers), and values are tuples containing two elements:
The first element is the worst-case SNR (float).
The second element is the best-case SNR (float).
The SNR estimates are zero if there are no sufficient voxels to calculate them (may occur if the number of orientations in the file is very low).
- Return type:
- mriqc.qc.diffusion.neighboring_dwi_correlation(dwi_data: ndarray, neighbor_indices: list[tuple[int, int]], mask: ndarray | None = None, decimals: int = 4) float[source]
Calculates the Neighboring DWI Correlation (NDC) from diffusion MRI (dMRI) data.
The NDC is a measure of the correlation between signal intensities in neighboring diffusion-weighted images (DWIs) within a mask. A low NDC (typically below 0.4) can indicate poor image quality, according to Yeh et al. [Yeh2019].
- Parameters:
- Returns:
The NDC value.
- Return type:
References
Notes
This is a copy of DIPY’s code to be removed (and just imported) as soon as a new release of DIPY is cut including dipy/dipy#3156.
- mriqc.qc.diffusion.noise_b0(in_b0: ndarray, percentiles: tuple[float, float, float] = (25.0, 50.0, 75.0), mask: ndarray | None = None) dict[str, float][source]
Estimates noise levels in raw dMRI data using the variance of the $b$=0 volumes.
This function calculates the variance of the $b$=0 volumes in a 4D dMRI array within a provided mask. It then computes the noise estimates at specified percentiles of the variance distribution. This approach assumes that noise primarily contributes to the lower end of the variance distribution. MRIQC does not report these estimates among the DWI IQMs.
- Parameters:
in_b0 (
ndarray) – The 3D or 4D dMRI data array. If 4D, the first volume (assumed to be the $b$=0 image) is used for noise estimation.percentiles (
tuple(float, float, float), optional (default=(25, 50, 75))) – A tuple of three integers specifying the percentiles of the variance distribution to use for noise estimation. These percentiles represent different noise levels within the data.mask (
ndarray, optional (default=``None``)) – A boolean mask used to restrict the noise estimation to specific brain regions. IfNone, a mask of ones with the same shape as the first 3 dimensions ofin_b0is used.
- Returns:
A dictionary containing the noise estimates at the specified percentiles:
- Return type:
- mriqc.qc.diffusion.spike_ppm(spike_mask: ndarray, slice_threshold: float = 0.05, decimals: int = 2) dict[str, float | ndarray][source]
Calculates fractions (global and slice-wise) of voxels classified as spikes in ppm.
This function computes two metrics:
Global spike parts-per-million [ppm]: Fraction of voxels exceeding the spike threshold across the entire data array.
Slice-wise spiking [ppm]: The fraction of slices along each dimension of the data array where the average fraction of spiking voxels within the slice exceeds a user-defined threshold (
slice_threshold).
- Parameters:
spike_mask (
ndarray(bool, same shape as data)) – The binary mask indicating spike voxels (True) and non-spike voxels (False).slice_threshold (
float, optional (default=0.05)) – The minimum fraction of voxels in a slice that must be classified as spikes for the slice to be considered spiking.decimals (
int) – The number of decimals to round the fractions.
- Returns:
A dictionary containing the calculated spike percentages:
- Return type: