nimare.diagnostics.ResampledStability

class ResampledStability(target_image='z_desc-size_level-cluster_corr-FWE_method-montecarlo', resampling_policy='subsample', k=None, target_n=None, n_resamples=None, random_state=None, voxel_thresh=None, cluster_threshold=None, mask_coverage='gm', alpha=0.05, n_cores=1, generate_description=True)[source]

Bases: NiMAREBase

Estimate voxelwise stability of thresholded results under dataset resampling.

Determine the stability of a meta-analytic result by applying a resampling policy to the input dataset and then characterizing the stability of the resulting meta-analytic map’s voxelwise and/or clusterwise significance. Based on the implementation in Frahm et al.[1].

Parameters:
  • target_image ('str', optional) – The meta-analytic map for which stability will be characterized.

  • resampling_policy ({"leave_1_out", "leave_k_out", "subsample"}, optional) – The resampling policy to use.

  • k (int, optional) – The number of studies to leave out for each replicate when resampling_policy="leave_k_out". Must be between 1 and n-1, where n is the number of studies in the meta-analysis.

  • target_n (int, optional) – The number of studies to include in each replicate when resampling_policy="subsample". Must be between 1 and n, where n is the number of studies in the meta-analysis. Default is n (i.e., subsamples are the same size as the original dataset).

  • n_resamples (int, optional) – The number of resampled replicates to generate. If None, all possible unique replicates will be generated, up to a maximum of 1000 (to avoid combinatorial explosion).

  • random_state (int or None, optional) – Random seed for reproducibility when random sampling is used in the resampling policy. Default is None.

  • 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.

  • cluster_threshold (int or None, optional) – Cluster size threshold, in voxels. If None, then no cluster size threshold will be applied. Default is None.

  • mask_coverage ({"gm", "brain"}, optional) – Voxel set used as the randomisation prior for the "subsample" policy. "gm" restricts random foci to grey-matter voxels (mask image intensity > 0.1); "brain" uses all non-zero voxels. Default is "gm".

  • alpha (float, optional) – Family-wise error rate for the Monte Carlo cluster-size threshold used in the "subsample" policy. The (1 - alpha) percentile of the permutation null distribution is applied. Default is 0.05.

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

  • generate_description (bool, optional) – Whether to append boilerplate text and extract references for the returned result. Default is True.

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 resampling diagnostic to a fitted meta-analytic result.

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 resampling diagnostic to a fitted meta-analytic result.

Examples using nimare.diagnostics.ResampledStability

Stability diagnostics: Jackknife vs. ResampledStability

Stability diagnostics: Jackknife vs. ResampledStability