nimare.diagnostics.FocusCounter

class FocusCounter(target_image='z_desc-size_level-cluster_corr-FWE_method-montecarlo', voxel_thresh=None, cluster_threshold=None, display_second_group=False, n_cores=1)[source]

Bases: Diagnostics

Run a focus-count analysis on a coordinate-based meta-analysis result.

Changed in version 0.1.2:

  • Support for pairwise meta-analyses.

Changed in version 0.0.14:

  • New parameter: cluster_threshold.

  • Return clusters table.

Changed in version 0.0.13: Change cluster neighborhood from faces+edges to faces, to match Nilearn.

Added in version 0.0.12.

Notes

This analysis characterizes the relative contribution of each experiment in a meta-analysis to the resulting clusters by counting the number of peaks from each experiment that fall within each significant cluster.

Warning

This method only works for coordinate-based meta-analyses.

Methods

get_params([deep])

Get parameters for this estimator.

load(filename[, compressed])

Load a pickled class instance from file.

save(filename[, compress])

Pickle the class instance to the provided file.

set_params(**params)

Set the parameters of this estimator.

transform(result)

Apply the analysis to a MetaResult.

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params – Parameter names mapped to their values.

Return type:

dict

classmethod load(filename, compressed=True)[source]

Load a pickled class instance from file.

Parameters:
  • filename (str) – Name of file containing object.

  • compressed (bool, default=True) – If True, the file is assumed to be compressed and gzip will be used to load it. Otherwise, it will assume that the file is not compressed. Default = True.

Returns:

obj – Loaded class object.

Return type:

class object

save(filename, compress=True)[source]

Pickle the class instance to the provided file.

Parameters:
  • filename (str) – File to which object will be saved.

  • compress (bool, optional) – If True, the file will be compressed with gzip. Otherwise, the uncompressed version will be saved. Default = True.

set_params(**params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Return type:

self

transform(result)[source]

Apply the analysis to a MetaResult.

Parameters:

result (MetaResult) – A MetaResult produced by a coordinate- or image-based meta-analysis.

Returns:

Results of Diagnostics fitting.

Return type:

MetaResult

Notes

This method adds two new keys to maps and tables attributes of the MetaResult object.

  • <target_image>_diag-<Jackknife|FocusCounter>_tab-counts : pandas.DataFrame or None. A DataFrame with information about relative contributions of each experiment to each cluster in the thresholded map. There is one row for each experiment. There is one column for each cluster, with column names being PostiveTail/NegativeTail indicating the sign (+/-) of the cluster’s statistical values, plus an integer indicating the cluster’s associated value in the label_maps[0]/label_maps[1] output. If no clusters are found or a pairwise Estimator was used, None is returned.

  • <target_image>_tab-clust : pandas.DataFrame A DataFrame with information about each cluster. There is one row for each cluster. The columns in this table include: Cluster ID (the cluster id, plus a letter for subpeaks only), X/Y/Z (coordinate for the center of mass), Max Stat (statistical value of the peak), and Cluster Size (mm3) (the size of the cluster, in cubic millimeters). If no clusters are found, this table will be empty.

  • label_<target_image>_tail-<positive|negative> : numpy.ndarray Label maps. Each cluster in the map has a single value, which corresponds to the cluster number of the column name in contribution_table. If target_image has negative values after thresholding, first and second maps correspond to positive and negative tails. If no clusters are found, this list will be empty.

Examples using nimare.diagnostics.FocusCounter

Two-sample ALE meta-analysis

Two-sample ALE meta-analysis