nimare.diagnostics.FocusCounter

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

Bases: nimare.base.NiMAREBase

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

New in version 0.0.12.

Parameters
  • target_image (str, optional) – The meta-analytic map for which clusters will be characterized. The default is z because log-p will not always have value of zero for non-cluster voxels.

  • voxel_thresh (float or None, optional) – An optional voxel-level threshold that may be applied to the target_image to define clusters. This can be None if the target_image is already thresholded (e.g., a cluster-level corrected map). Default is None.

  • n_cores (int, optional) – Number of cores to use for parallelization. If <=0, defaults to using all available cores. Default is 1.

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.

Pairwise meta-analyses, like ALESubtraction and MKDAChi2, are not yet supported in this method.

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, optional) – 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, optional) – 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

  • contribution_table (pandas.DataFrame) – A DataFrame with information about relative contributions of each experiment to each cluster in the thresholded map. There is one row for each experiment, as well as one more row at the top of the table (below the header), which has the center of mass of each cluster. The centers of mass are not guaranteed to fall within the actual clusters, but can serve as a useful heuristic for identifying them. There is one column for each cluster, with column names being integers indicating the cluster’s associated value in the labeled_cluster_img output.

  • labeled_cluster_img (nibabel.nifti1.Nifti1Image) – The labeled, thresholded map that is used to identify clusters characterized by this analysis. Each cluster in the map has a single value, which corresponds to the cluster’s column name in contribution_table.

Examples using nimare.diagnostics.FocusCounter