nimare.meta.cbmr.CBMRResult

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

Bases: MetaResult

Meta-analytic result for CBMR with result-centered inference helpers.

Methods

compare_groups(contrasts[, device])

Run pairwise group-comparison tests using names or (group_a, group_b) tuples.

compare_moderators(contrasts[, device])

Run pairwise moderator-comparison tests using names or tuples.

copy()

Return a copy of the CBMR result object.

describe_inference_inputs()

Summarize the fitted groups and moderators for follow-up inference.

get_inference([device])

Return a fitted inference engine for advanced CBMR use cases.

get_map(name[, return_type])

Get stored map as image or array.

get_params([deep])

Get parameters for this estimator.

infer([group_contrasts, ...])

Run CBMR inference from a fitted result.

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.

test_groups([groups, device])

Run one-group spatial homogeneity tests for the requested groups.

test_moderators([moderators, device])

Test whether the requested moderator effects differ from zero.

Properties

description_

A textual description of the method that generated the result.

groups

Return fitted group names in display order.

moderators

Return fitted moderator names in display order.

compare_groups(contrasts, device=None)[source]

Run pairwise group-comparison tests using names or (group_a, group_b) tuples.

compare_moderators(contrasts, device=None)[source]

Run pairwise moderator-comparison tests using names or tuples.

copy()[source]

Return a copy of the CBMR result object.

describe_inference_inputs()[source]

Summarize the fitted groups and moderators for follow-up inference.

property description_

A textual description of the method that generated the result.

Type:

str

get_inference(device=None)[source]

Return a fitted inference engine for advanced CBMR use cases.

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

property groups

Return fitted group names in display order.

infer(group_contrasts=False, moderator_contrasts=False, device=None)[source]

Run CBMR inference from a fitted result.

Parameters:
  • group_contrasts (bool, dict, list, tuple, str, or None, optional) – Group homogeneity or comparison specification. Use False to skip group inference.

  • moderator_contrasts (bool, dict, list, tuple, str, or None, optional) – Moderator effect or comparison specification. Use False to skip moderator inference.

  • device (str, optional) – Compute device to use for inference. Defaults to the device recorded on the fitted estimator.

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

property moderators

Return fitted moderator names in display order.

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

test_groups(groups=None, device=None)[source]

Run one-group spatial homogeneity tests for the requested groups.

test_moderators(moderators=None, device=None)[source]

Test whether the requested moderator effects differ from zero.