Skip to content

Commit c9f8ee2

Browse files
authored
BUG: Fix bug with example (#12786)
1 parent 01a1c1e commit c9f8ee2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tutorials/stats-sensor-space/70_cluster_rmANOVA_time_freq.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,16 @@ def stat_fun(*args):
239239
n_permutations=n_permutations,
240240
buffer_size=None,
241241
out_type="mask",
242+
seed=0,
242243
)
243244

244245
# %%
245246
# Create new stats image with only significant clusters:
246247

247248
good_clusters = np.where(cluster_p_values < 0.05)[0]
248-
F_obs_plot = F_obs.copy()
249-
F_obs_plot[~clusters[np.squeeze(good_clusters)]] = np.nan
249+
F_obs_plot = np.full_like(F_obs, np.nan)
250+
for ii in good_clusters:
251+
F_obs_plot[clusters[ii]] = F_obs[clusters[ii]]
250252

251253
fig, ax = plt.subplots(figsize=(6, 4), layout="constrained")
252254
for f_image, cmap in zip([F_obs, F_obs_plot], ["gray", "autumn"]):

0 commit comments

Comments
 (0)