nimare.results.MetaResult

class MetaResult(estimator, corrector=None, diagnostics=None, mask=None, maps=None, tables=None, description='')[source]

Bases: NiMAREBase

Base class for meta-analytic results.

Changed in version 0.1.0:

  • Added corrector and diagnostics attributes.

Changed in version 0.0.12:

  • Added the description attribute.

Parameters:
  • estimator (Estimator) – The Estimator used to generate the maps in the MetaResult.

  • corrector (Corrector) – The Corrector used to correct the maps in the MetaResult.

  • diagnostics (list of Diagnostics) – List of diagnostic classes.

  • mask (Niimg-like or nilearn.input_data.base_masker.BaseMasker) – Mask for converting maps between arrays and images.

  • maps (None or dict of numpy.ndarray, optional) – Maps to store in the object. The maps must be provided as 1D numpy arrays. Default is None.

  • tables (None or dict of pandas.DataFrame, optional) – Pandas DataFrames to store in the object. Default is None.

  • description (str, optional) – Description of the method that generated the result. Default is “”.

Variables:
  • estimator (Estimator) – The Estimator used to generate the maps in the MetaResult.

  • corrector (Corrector) – The Corrector used to correct the maps in the MetaResult.

  • diagnostics (list of Diagnostics) – List of diagnostic classes.

  • masker (NiftiMasker or similar) – Masker object.

  • maps (dict) – Keys are map names and values are 1D arrays.

  • tables (dict) – Keys are table levels and values are pandas DataFrames.

  • description (str) –

    A textual description of the method that generated the result.

    Citations in this description are formatted according to natbib’s LaTeX format.

  • bibtex (str) –

    The BibTeX entries for any citations in description. These entries are extracted from NiMARE’s references.bib file and filtered based on the description automatically.

    Users should be able to copy the contents of the bibtex attribute into their own BibTeX file without issue.

Methods

copy()

Return copy of result object.

get_map(name[, return_type])

Get stored map as image or array.

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.

save_maps([output_dir, prefix, prefix_sep, ...])

Save results to files.

save_tables([output_dir, prefix, ...])

Save result tables to TSV files.

set_params(**params)

Set the parameters of this estimator.

Properties

description_

A textual description of the method that generated the result.

copy()[source]

Return copy of result object.

property description_

A textual description of the method that generated the result.

Type:

str

get_map(name, return_type='image')[source]

Get stored map as image or array.

Parameters:
  • name (str) – Name of the map. Used to index self.maps.

  • return_type ({'image', 'array'}, optional) – Whether to return a niimg (‘image’) or a numpy array. Default is ‘image’.

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.

save_maps(output_dir='.', prefix='', prefix_sep='_', names=None)[source]

Save results to files.

Parameters:
  • output_dir (str, optional) – Output directory in which to save results. If the directory doesn’t exist, it will be created. Default is current directory.

  • prefix (str, optional) – Prefix to prepend to output file names. Default is None.

  • prefix_sep (str, optional) – Separator to add between prefix and default file names. Default is _.

  • names (None or list of str, optional) – Names of specific maps to write out. If None, save all maps. Default is None.

save_tables(output_dir='.', prefix='', prefix_sep='_', names=None)[source]

Save result tables to TSV files.

Parameters:
  • output_dir (str, optional) – Output directory in which to save results. If the directory doesn’t exist, it will be created. Default is current directory.

  • prefix (str, optional) – Prefix to prepend to output file names. Default is None.

  • prefix_sep (str, optional) – Separator to add between prefix and default file names. Default is _.

  • names (None or list of str, optional) – Names of specific tables to write out. If None, save all tables. Default is None.

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

Examples using nimare.results.MetaResult

Use NeuroVault statistical maps in NiMARE

Use NeuroVault statistical maps in NiMARE

Coordinate-based meta-analysis algorithms

Coordinate-based meta-analysis algorithms

Image-based meta-analysis algorithms

Image-based meta-analysis algorithms

The Estimator class

The Estimator class

The Corrector class

The Corrector class

Compare image and coordinate based meta-analyses

Compare image and coordinate based meta-analyses

Two-sample ALE meta-analysis

Two-sample ALE meta-analysis

Simulate data for coordinate based meta-analysis

Simulate data for coordinate based meta-analysis

Run a coordinate-based meta-analysis (CBMA) workflow

Run a coordinate-based meta-analysis (CBMA) workflow

Coordinate-based meta-regression algorithms

Coordinate-based meta-regression algorithms

Run an image-based meta-analysis (IBMA) workflow

Run an image-based meta-analysis (IBMA) workflow