nimare.workflows.cbma.ContrastWorkflow

ContrastWorkflow(main_estimator=<class 'nimare.meta.cbma.ale.ALE'>, pairwise_estimator=<class 'nimare.meta.cbma.ale.ALESubtraction'>, corrector=None, alpha=0.05, output_dir=None, generate_description=True, n_cores=1)[source]

Compose a masked contrast workflow for pairwise CBMA analyses.

This workflow fits separate one-sample main-effect analyses for two groups, corrects and thresholds those main effects, and passes the thresholded maps to the pairwise estimator as directional inference masks. Positive group1 > group2 effects are evaluated only where group 1 has a surviving main effect, and negative group2 > group1 effects are evaluated only where group 2 has a surviving main effect. This differs from a standard ALESubtraction run without inference maps, which evaluates differences across all voxels in the analysis mask.

The workflow then thresholds the pairwise contrast p-values at alpha and stores the thresholded contrast z map. It also stores the thresholded group main-effect maps and a voxelwise-minimum conjunction of those maps. This mirrors the main-effect-gated ALE subtraction logic used in earlier ALE subtraction workflows [1], while keeping the correction and gating steps explicit in NiMARE. This specific implementation was based on Frahm et al.[2].

Parameters:
  • main_estimator (CBMAEstimator, str {‘ale’, ‘scale’, ‘mkdadensity’, ‘kda’}, optional) – Estimator to use for computing main effects. Default is ALE.

  • pairwise_estimator (PairwiseCBMAEstimator, str {‘alesubtraction’, ‘mkdachi2’}, optional) – Estimator to use for computing pairwise contrast. Default is ALESubtraction.

  • corrector (Corrector, str {‘fdr’, ‘montecarlo’, ‘bonferroni’}, optional) – Corrector to use for correcting main effects. Default is FDRCorrector with method="indep".

  • alpha (float, optional) – Significance level to use for thresholding main effects and pairwise contrast. Default is 0.05.

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

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

  • n_cores (int, optional) – Number of cores to use for parallelization. If main_estimator, pairwise_estimator, or corrector are passed as already-initialized instances this parameter will be ignored for those objects. Default is 1.