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.reporting.get_clusters_table

nilearn.reporting.get_clusters_table(stat_img, stat_threshold, cluster_threshold=None, two_sided=False, min_distance=8.0, return_label_maps=False)[source]

Create pandas dataframe with img cluster statistics.

This function should work on any statistical maps where more extreme values indicate greater statistical significance. For example, z-statistic or -log10(p) maps are valid inputs, but a p-value map is not.

Important

For binary clusters (clusters comprised of only one value), the table reports the center of mass of the cluster, rather than any peaks/subpeaks.

This center of mass may, in some cases, appear outside of the cluster.

Changed in version 0.9.2: In this case, the cluster voxel nearest to the center of mass is reported.

Parameters:
stat_imgNiimg-like object

Statistical image to threshold and summarize.

stat_thresholdfloat

Cluster forming threshold. This value must be in the same scale as stat_img.

cluster_thresholdint or None, default=None

Cluster size threshold, in voxels. If None, then no cluster size threshold will be applied.

two_sidedbool, default=False

Whether to employ two-sided thresholding or to evaluate positive values only.

min_distancefloat, default=8

Minimum distance between subpeaks, in millimeters.

Note

If two different clusters are closer than min_distance, it can result in peaks closer than min_distance.

return_label_mapsbool, default=False

Whether or not to additionally output cluster label map images.

Added in version 0.10.1.

Returns:
result_tablepandas.DataFrame

Table with peaks and subpeaks from thresholded stat_img. The columns in this table include:

Cluster ID

The cluster number. Subpeaks have letters after the number.

X/Y/Z

The coordinate for the peak, in millimeters.

Peak Stat

The statistical value associated with the peak. The statistic type is dependent on the type of the statistical image.

Cluster Size (mm3)

The size of the cluster, in millimeters cubed. Rows corresponding to subpeaks will not have a value in this column.

label_mapslist

Returned if return_label_maps=True List of Niimg-like objects of cluster label maps. If two_sided==True, first and second maps correspond to positive and negative tails.

Added in version 0.10.1.

Examples using nilearn.reporting.get_clusters_table

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

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

Predicted time series and residuals

Predicted time series and residuals

First level analysis of a complete BIDS dataset from openneuro

First level analysis of a complete BIDS dataset from openneuro