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)[source]#

Creates 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.2dev: 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, optional

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

two_sidedbool, optional

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

min_distancefloat, optional

Minimum distance between subpeaks, in millimeters. Default=8.

Note

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

Returns
dfpandas.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.

Examples using nilearn.reporting.get_clusters_table#

First level analysis of a complete BIDS dataset from openneuro

First level analysis of a complete BIDS dataset from openneuro

First level analysis of a complete BIDS dataset from openneuro