Skip to content

Commit 4a6b76e

Browse files
authored
[ENH] ale subtraction scale improvements (#1002)
* Optimize SCALE and ALESubtraction Monte Carlo workflows Use empirical voxelwise SCALE nulls and add voxel-level Monte Carlo FWE support. Stream ALESubtraction voxelwise null updates to reduce storage overhead, speed shared cluster and null-distribution helpers, and deduplicate shared permutation summarystat generation in the CBMA base path. * Document SCALE Monte Carlo FWE usage in examples Update the MACM and CBMA example snippets to show voxel-level Monte Carlo FWE correction for SCALE and clarify that cluster-level correction is not supported. * clear up documentation and minor refactor * name the variables more clearly
1 parent eedba56 commit 4a6b76e

7 files changed

Lines changed: 525 additions & 337 deletions

File tree

examples/02_meta-analyses/01_plot_cbma.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def subset_studies(studyset, start=None, stop=None):
192192
#
193193
# import numpy as np
194194
#
195+
# from nimare.correct import FWECorrector
195196
# from nimare.meta.cbma.ale import SCALE
196197
# from nimare.utils import vox2mm
197198
#
@@ -202,6 +203,8 @@ def subset_studies(studyset, start=None, stop=None):
202203
#
203204
# meta = SCALE(xyz=xyz, n_iters=10)
204205
# results = meta.fit(dset)
206+
# corr = FWECorrector(method="montecarlo", n_iters=10, n_cores=1)
207+
# cres = corr.transform(results)
205208

206209
###############################################################################
207210
# ALE-Based Subtraction Analysis

examples/02_meta-analyses/07_macm.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,20 @@
8383
# SCALE
8484
# -----------------------------------------------------------------------------
8585
# Another good option for a MACM analysis is the SCALE algorithm, which was
86-
# designed specifically for MACM. Unfortunately, SCALE does not support
87-
# multiple-comparisons correction.
86+
# designed specifically for MACM.
87+
# NiMARE supports voxel-level Monte Carlo FWE correction for SCALE, but not
88+
# cluster-level correction.
8889

8990
# First, we must define our null model of reported coordinates in the literature.
9091
# We will use the coordinates in Neurosynth
9192
xyz = studyset.coordinates[["x", "y", "z"]].values
9293
scale = SCALE(xyz=xyz, n_iters=10000, n_cores=1, kernel__n=20)
9394
results = scale.fit(studyset_sel)
94-
plotting.plot_stat_map(results.get_map("z"), draw_cross=False, cmap="RdBu_r", symmetric_cbar=True)
95+
corr = FWECorrector(method="montecarlo", n_iters=10000, n_cores=1)
96+
cres = corr.transform(results)
97+
plotting.plot_stat_map(
98+
cres.get_map("z_level-voxel_corr-FWE_method-montecarlo"),
99+
draw_cross=False,
100+
cmap="RdBu_r",
101+
symmetric_cbar=True,
102+
)

0 commit comments

Comments
 (0)