IQMs for structural images

Measures based on noise measurements

  • cjv()coefficient of joint variation (CJV): The cjv of GM and WM was proposed as objective function by [Ganzetti2016] for the optimization of INU correction algorithms. Higher values are related to the presence of heavy head motion and large INU artifacts. Lower values are better.

  • cnr()contrast-to-noise ratio (CNR): The cnr [Magnota2006], is an extension of the SNR calculation to evaluate how separated the tissue distributions of GM and WM are. Higher values indicate better quality.

  • snr()signal-to-noise ratio (SNR): calculated within the tissue mask.

  • art_qi2(): Mortamet’s quality index 2 (QI2) is a calculation of the goodness-of-fit of a \(\chi^2\) distribution on the air mask, once the artifactual intensities detected for computing the QI1 index have been removed [Mortamet2009]. Lower values are better.

Measures based on information theory

  • efc(): The EFC [Atkinson1997] uses the Shannon entropy of voxel intensities as an indication of ghosting and blurring induced by head motion. Lower values are better.

    The original equation is normalized by the maximum entropy, so that the EFC can be compared across images with different dimensions.

Measures targeting specific artifacts

  • inu_* (nipype interface to N4ITK): summary statistics (max, min and median) of the INU field (bias field) as extracted by the N4ITK algorithm [Tustison2010]. Values closer to 1.0 are better, values further from zero indicate greater RF field inhomogeneity.

  • art_qi1(): Detect artifacts in the image using the method described in [Mortamet2009]. The QI1 is the proportion of voxels with intensity corrupted by artifacts normalized by the number of voxels in the background. Lower values are better.

    ../_images/mortamet-mrm2009.png

    The workflow to compute the artifact detection from [Mortamet2009].

  • wm2max(): The white-matter to maximum intensity ratio is the median intensity within the WM mask over the 95% percentile of the full intensity distribution, that captures the existence of long tails due to hyper-intensity of the carotid vessels and fat. Values should be around the interval [0.6, 0.8].

Other measures

  • fwhm (nipype interface to AFNI): The FWHM of the spatial distribution of the image intensity values in units of voxels [Forman1995]. Lower values are better, higher values indicate a blurrier image. Uses the gaussian width estimator filter implemented in AFNI’s 3dFWHMx:

    \[\text{FWHM} = \sqrt{-{\left[4 \ln{(1-\frac{\sigma^2_{X^m_{i+1,j}-X^m_{i,j}}} {2\sigma^2_{X^m_{i,j}}}})\right]}^{-1}}\]
  • volume_fraction() (icvs_*): the ICV fractions of CSF, GM and WM. They should move within a normative range.

  • rpve() (rpve_*): the rPVe of CSF, GM and WM. Lower values are better.

  • summary_stats() (summary_*_*): Mean, median, median absolute deviation (mad), standard deviation, kurtosis, 5% percentile, 95% percentile and number of voxels of the distribution of background, CSF, GM and WM.

  • overlap_*_*: The overlap of the TPMs estimated from the image and the corresponding maps from the ICBM nonlinear-asymmetric 2009c template. Higher values are better.

    \[\text{JI}^k = \frac{\sum_i \min{(\text{TPM}^k_i, \text{MNI}^k_i)}} {\sum_i \max{(\text{TPM}^k_i, \text{MNI}^k_i)}}\]

References

Dietrich2007(1,2)

Dietrich et al., Measurement of SNRs in MR images: influence of multichannel coils, parallel imaging and reconstruction filters, JMRI 26(2):375–385. 2007. doi:10.1002/jmri.20969.

Ganzetti2016(1,2)

Ganzetti et al., Intensity inhomogeneity correction of structural MR images: a data-driven approach to define input algorithm parameters. Front Neuroinform 10:10. 2016. doi:10.3389/fninf.2016.00010.

Magnota2006(1,2)

Magnotta, VA., & Friedman, L., Measurement of signal-to-noise and contrast-to-noise in the fBIRN multicenter imaging study. J Dig Imag 19(2):140-147, 2006. doi:10.1007/s10278-006-0264-x.

Mortamet2009(1,2,3,4)

Mortamet B et al., Automatic quality assessment in structural brain magnetic resonance imaging, Mag Res Med 62(2):365-372, 2009. doi:10.1002/mrm.21992.

Tustison2010

Tustison NJ et al., N4ITK: improved N3 bias correction, IEEE Trans Med Imag, 29(6):1310-20, 2010. doi:10.1109/TMI.2010.2046908.

Shehzad2015(1,2)

Shehzad Z et al., The Preprocessed Connectomes Project Quality Assessment Protocol - a resource for measuring the quality of MRI data, Front. Neurosci. Conference Abstract: Neuroinformatics 2015. doi:10.3389/conf.fnins.2015.91.00047.

Forman1995

Forman SD et al., Improved assessment of significant activation in functional magnetic resonance imaging (fMRI): use of a cluster-size threshold, Magn. Reson. Med. 33 (5), 636–647, 1995. doi:10.1002/mrm.1910330508.

mriqc.qc.anatomical.art_qi1(airmask, artmask)[source]

Detect artifacts in the image using the method described in [Mortamet2009]. Calculates \(\text{QI}_1\), as the proportion of voxels with intensity corrupted by artifacts normalized by the number of voxels in the “hat” mask (i.e., the background region above the nasio-occipital plane):

\[\text{QI}_1 = \frac{1}{N} \sum\limits_{x\in X_\text{art}} 1\]

Near-zero values are better. If \(\text{QI}_1 = -1\), then the “hat” mask (background) was empty and the dataset is likely a skull-stripped image or has been heavily post-processed.

Parameters
mriqc.qc.anatomical.art_qi2(img, airmask, min_voxels=1000, max_voxels=300000, save_plot=True, coil_elements=32)[source]

Calculates \(\text{QI}_2\), based on the goodness-of-fit of a centered \(\chi^2\) distribution onto the intensity distribution of non-artifactual background (within the “hat” mask):

\[\chi^2_n = \frac{2}{(\sigma \sqrt{2})^{2n} \, (n - 1)!}x^{2n - 1}\, e^{-\frac{x}{2}}\]

where \(n\) is the number of coil elements.

Parameters
mriqc.qc.anatomical.cjv(mu_wm, mu_gm, sigma_wm, sigma_gm)[source]

Calculate the CJV, a measure related to SNR and CNR that is presented as a proxy for the INU artifact [Ganzetti2016]. Lower is better.

\[\text{CJV} = \frac{\sigma_\text{WM} + \sigma_\text{GM}}{|\mu_\text{WM} - \mu_\text{GM}|}.\]
Parameters
  • mu_wm (float) – mean of signal within white-matter mask.

  • mu_gm (float) – mean of signal within gray-matter mask.

  • sigma_wm (float) – standard deviation of signal within white-matter mask.

  • sigma_gm (float) – standard deviation of signal within gray-matter mask.

Returns

the computed CJV

mriqc.qc.anatomical.cnr(mu_wm, mu_gm, sigma_air, sigma_wm, sigma_gm)[source]

Calculate the CNR [Magnota2006]. Higher values are better.

\[\text{CNR} = \frac{|\mu_\text{GM} - \mu_\text{WM} |}{\sqrt{\sigma_B^2 + \sigma_\text{WM}^2 + \sigma_\text{GM}^2}},\]

where \(\sigma_B\) is the standard deviation of the noise distribution within the air (background) mask.

Parameters
  • mu_wm (float) – mean of signal within white-matter mask.

  • mu_gm (float) – mean of signal within gray-matter mask.

  • sigma_air (float) – standard deviation of the air surrounding the head (“hat” mask).

  • sigma_wm (float) – standard deviation within white-matter mask.

  • sigma_gm (float) – standard within gray-matter mask.

Returns

the computed CNR

mriqc.qc.anatomical.efc(img, framemask=None)[source]

Calculate the EFC [Atkinson1997]. Uses the Shannon entropy of voxel intensities as an indication of ghosting and blurring induced by head motion. A range of low values is better, with EFC = 0 for all the energy concentrated in one pixel.

\[\text{E} = - \sum_{j=1}^N \frac{x_j}{x_\text{max}} \ln \left[\frac{x_j}{x_\text{max}}\right]\]

with \(x_\text{max} = \sqrt{\sum_{j=1}^N x^2_j}\).

The original equation is normalized by the maximum entropy, so that the EFC can be compared across images with different dimensions:

\[\text{EFC} = \left( \frac{N}{\sqrt{N}} \, \log{\sqrt{N}^{-1}} \right) \text{E}\]
Parameters
mriqc.qc.anatomical.fber(img, headmask, rotmask=None)[source]

Calculate the FBER [Shehzad2015], defined as the mean energy of image values within the head relative to outside the head. Higher values are better, and an FBER=-1.0 indicates that there is no signal outside the head mask (e.g., a skull-stripped dataset).

\[\text{FBER} = \frac{E[|F|^2]}{E[|B|^2]}\]
Parameters
  • img (numpy.ndarray) – input data

  • headmask (numpy.ndarray) – a mask of the head (including skull, skin, etc.)

  • rotmask (numpy.ndarray) – a mask of empty voxels inserted after a rotation of data

mriqc.qc.anatomical.rpve(pvms, seg)[source]

Computes the rPVe of each tissue class.

\[\text{rPVE}^k = \frac{1}{N} \left[ \sum\limits_{p^k_i \in [0.5, P_{98}]} p^k_i + \sum\limits_{p^k_i \in [P_{2}, 0.5)} 1 - p^k_i \right]\]
mriqc.qc.anatomical.snr(mu_fg, sigma_fg, n)[source]

Calculate the SNR. The estimation may be provided with only one foreground region in which the noise is computed as follows:

\[\text{SNR} = \frac{\mu_F}{\sigma_F\sqrt{n/(n-1)}},\]

where \(\mu_F\) is the mean intensity of the foreground and \(\sigma_F\) is the standard deviation of the same region.

Parameters
  • mu_fg (float) – mean of foreground.

  • sigma_fg (float) – standard deviation of foreground.

  • n (int) – number of voxels in foreground mask.

Returns

the computed SNR

mriqc.qc.anatomical.snr_dietrich(mu_fg, mad_air=0.0, sigma_air=1.0)[source]

Calculate the SNR.

This must be an air mask around the head, and it should not contain artifacts. The computation is done following the eq. A.12 of [Dietrich2007], which includes a correction factor in the estimation of the standard deviation of air and its Rayleigh distribution:

\[\text{SNR} = \frac{\mu_F}{\sqrt{\frac{2}{4-\pi}}\,\sigma_\text{air}}.\]
Parameters
  • mu_fg (float) – mean of foreground.

  • sigma_air (float) – standard deviation of the air surrounding the head (“hat” mask).

Returns

the computed SNR for the foreground segmentation

mriqc.qc.anatomical.summary_stats(data, pvms, airmask=None, erode=True)[source]

Estimates the mean, the median, the standard deviation, the kurtosis,the median absolute deviation (mad), the 95% and the 5% percentiles and the number of voxels (summary_*_n) of each tissue distribution.

Warning

Sometimes (with datasets that have been partially processed), the air mask will be empty. In those cases, the background stats will be zero for the mean, median, percentiles and kurtosis, the sum of voxels in the other remaining labels for n, and finally the MAD and the \(\sigma\) will be calculated as:

\[\sigma_\text{BG} = \sqrt{\sum \sigma_\text{i}^2}\]
mriqc.qc.anatomical.volume_fraction(pvms)[source]

Computes the ICV fractions corresponding to the (partial volume maps).

\[\text{ICV}^k = \frac{\sum_i p^k_i}{\sum\limits_{x \in X_\text{brain}} 1}\]
Parameters

pvms (list) – list of numpy.ndarray of partial volume maps.

mriqc.qc.anatomical.wm2max(img, mu_wm)[source]

Calculate the WM2MAX, defined as the maximum intensity found in the volume w.r.t. the mean value of the white matter tissue. Values close to 1.0 are better:

\[\text{WM2MAX} = \frac{\mu_\text{WM}}{P_{99.95}(X)}\]