Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.glm.threshold_stats_img#

nilearn.glm.threshold_stats_img(stat_img=None, mask_img=None, alpha=0.001, threshold=3.0, height_control='fpr', cluster_threshold=0, two_sided=True)[source]#

Compute the required threshold level and return the thresholded map

Parameters
stat_imgNiimg-like object or None, optional

Statistical image (presumably in z scale) whenever height_control is ‘fpr’ or None, stat_img=None is acceptable. If it is ‘fdr’ or ‘bonferroni’, an error is raised if stat_img is None.

mask_imgNiimg-like object, optional,

Mask image

alphafloat or list, optional

Number controlling the thresholding (either a p-value or q-value). Its actual meaning depends on the height_control parameter. This function translates alpha to a z-scale threshold. Default=0.001.

thresholdfloat, optional

Desired threshold in z-scale. This is used only if height_control is None. Default=3.0.

height_controlstring, or None optional

False positive control meaning of cluster forming threshold: None|’fpr’|’fdr’|’bonferroni’ Default=’fpr’.

cluster_thresholdfloat, optional

cluster size threshold. In the returned thresholded map, sets of connected voxels (clusters) with size smaller than this number will be removed. Default=0.

two_sidedBool, optional

Whether the thresholding should yield both positive and negative part of the maps. In that case, alpha is corrected by a factor of 2. Default=True.

Returns
thresholded_mapNifti1Image,

The stat_map thresholded at the prescribed voxel- and cluster-level.

thresholdfloat

The voxel-level threshold used actually.

See also

nilearn.image.threshold_img

Apply an explicit voxel-level (and optionally cluster-level) threshold without correction.

Notes

If the input image is not z-scaled (i.e. some z-transformed statistic) the computed threshold is not rigorous and likely meaningless

This function is experimental. It may change in any future release of Nilearn.

Examples using nilearn.glm.threshold_stats_img#

Intro to GLM Analysis: a single-session, single-subject fMRI dataset

Intro to GLM Analysis: a single-session, single-subject fMRI dataset

Intro to GLM Analysis: a single-session, single-subject fMRI dataset
Statistical testing of a second-level analysis

Statistical testing of a second-level analysis

Statistical testing of a second-level analysis
Voxel-Based Morphometry on OASIS dataset

Voxel-Based Morphometry on OASIS dataset

Voxel-Based Morphometry on OASIS dataset
Example of generic design in second-level models

Example of generic design in second-level models

Example of generic design in second-level models