nimare.meta.cbmr.CBMRResult
- class CBMRResult(estimator, corrector=None, diagnostics=None, mask=None, maps=None, tables=None, description='')[source]
Bases:
MetaResultMeta-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.
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
A textual description of the method that generated the result.
Return fitted group names in display order.
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.
- describe_inference_inputs()[source]
Summarize the fitted groups and moderators for follow-up inference.
- 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’.
- 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
Falseto skip group inference.moderator_contrasts (bool, dict, list, tuple, str, or None, optional) – Moderator effect or comparison specification. Use
Falseto 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:
- Returns:
obj – Loaded class object.
- Return type:
class object
- property moderators
Return fitted moderator names in display order.
- 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
listofstr, 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
listofstr, 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