Skip to content

Commit

Permalink
Add support for the concordant mode test in Fisher's and Stouffer's…
Browse files Browse the repository at this point in the history
… estimators (#884)

* Add support for the `concordant` mode test in Fisher's and Stouffer's estimators

* Update figures.py

* Update figures.py

* Update base.py

* Update figures.py

* Update figures.py

* Set symmetric_cbar to True in the example gallery

* Update figures.py

* Update references.bib

* Update ibma.py

* Update ibma.py
  • Loading branch information
JulioAPeraza authored May 28, 2024
1 parent 80cc7a5 commit d95c18b
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 9 deletions.
10 changes: 10 additions & 0 deletions examples/02_meta-analyses/01_plot_cbma.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
For a more detailed introduction to the elements of a coordinate-based
meta-analysis, see other stuff.
"""

###############################################################################
# Load Dataset
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -57,13 +58,15 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)
plot_stat_map(
cres.get_map("z_level-voxel_corr-FWE_method-montecarlo"),
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)

Expand All @@ -87,12 +90,14 @@
results.get_map("z_desc-uniformity"),
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)
plot_stat_map(
cres.get_map("z_desc-uniformitySize_level-cluster_corr-FWE_method-montecarlo"),
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)

Expand All @@ -117,13 +122,15 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)
plot_stat_map(
cres.get_map("z_desc-size_level-cluster_corr-FWE_method-montecarlo"),
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)

Expand All @@ -148,13 +155,15 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)
plot_stat_map(
cres.get_map("z_desc-size_level-cluster_corr-FWE_method-montecarlo"),
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)

Expand Down Expand Up @@ -200,6 +209,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.1,
)

Expand Down
9 changes: 9 additions & 0 deletions examples/02_meta-analyses/02_plot_ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
For a more detailed introduction to the elements of an image-based
meta-analysis, see other stuff.
"""

from nilearn.plotting import plot_stat_map

###############################################################################
Expand Down Expand Up @@ -56,6 +57,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -74,6 +76,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -94,6 +97,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -115,6 +119,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

corrector = FWECorrector(method="montecarlo", n_iters=100, n_cores=1)
Expand All @@ -125,6 +130,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -145,6 +151,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -165,6 +172,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand All @@ -185,6 +193,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

print("Description:")
Expand Down
5 changes: 5 additions & 0 deletions examples/02_meta-analyses/03_plot_kernel_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
This example provides an introduction to the ``KernelTransformer`` class and
a tour of available types.
"""

# sphinx_gallery_thumbnail_number = 2
import os

Expand Down Expand Up @@ -99,6 +100,7 @@
annotate=False,
colorbar=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand All @@ -115,6 +117,7 @@
title="MKDA",
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand All @@ -131,6 +134,7 @@
title="KDA",
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand All @@ -150,4 +154,5 @@
title="ALE",
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)
4 changes: 4 additions & 0 deletions examples/02_meta-analyses/05_plot_correctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Here we take a look at multiple comparisons correction in meta-analyses.
"""

from pprint import pprint

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -119,6 +120,7 @@
cres.get_map(map_name),
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.5,
cut_coords=[0, 0, -8],
figure=fig,
Expand Down Expand Up @@ -157,6 +159,7 @@
cres.get_map("z"),
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.5,
cut_coords=[0, 0, -8],
figure=fig,
Expand All @@ -167,6 +170,7 @@
cres.get_map("z_corr-FDR_method-indep"),
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
threshold=0.5,
cut_coords=[0, 0, -8],
figure=fig,
Expand Down
3 changes: 3 additions & 0 deletions examples/02_meta-analyses/06_plot_compare_ibma_and_cbma.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Collection of NIDM-Results packs downloaded from Neurovault collection 1425,
uploaded by Dr. Camille Maumet.
"""

import os

import pandas as pd
Expand Down Expand Up @@ -53,6 +54,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand All @@ -65,6 +67,7 @@
cut_coords=[0, 0, -8],
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand Down
4 changes: 3 additions & 1 deletion examples/02_meta-analyses/07_macm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
analysis in which task-independent "connectivity" is assessed by selecting
studies within a larger database based on locations of report coordinates.
"""

import nibabel as nib
import numpy as np
from nilearn import datasets, image, plotting
Expand Down Expand Up @@ -71,6 +72,7 @@
threshold=3.09,
draw_cross=False,
cmap="RdBu_r",
symmetric_cbar=True,
)

###############################################################################
Expand All @@ -85,4 +87,4 @@
xyz = dset.coordinates[["x", "y", "z"]].values
scale = SCALE(xyz=xyz, n_iters=10000, n_cores=1, kernel__n=20)
results = scale.fit(dset_sel)
plotting.plot_stat_map(results.get_map("z"), draw_cross=False, cmap="RdBu_r")
plotting.plot_stat_map(results.get_map("z"), draw_cross=False, cmap="RdBu_r", symmetric_cbar=True)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
5. Compare the two samples with a subtraction analysis.
6. Compare the two within-sample meta-analyses with a conjunction analysis.
"""

import os
from pathlib import Path

Expand Down Expand Up @@ -71,6 +72,7 @@
title="Semantic knowledge",
threshold=2.326, # cluster-level p < .01, one-tailed
cmap="RdBu_r",
symmetric_cbar=True,
vmax=4,
axes=axes[0],
figure=fig,
Expand All @@ -86,6 +88,7 @@
title="Semantic relatedness",
threshold=2.326, # cluster-level p < .01, one-tailed
cmap="RdBu_r",
symmetric_cbar=True,
vmax=4,
axes=axes[1],
figure=fig,
Expand Down Expand Up @@ -189,6 +192,7 @@
title="Conjunction",
threshold=2.326, # cluster-level p < .01, one-tailed
cmap="RdBu_r",
symmetric_cbar=True,
vmax=4,
)

Expand Down
2 changes: 2 additions & 0 deletions examples/02_meta-analyses/10_plot_cbma_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
This tutorial will walk you through using a CBMA workflow function which puts together
the fundamental steps of a CBMA meta-analysis.
"""

import os
from pathlib import Path

Expand Down Expand Up @@ -62,6 +63,7 @@
display_mode="z",
threshold=1.65, # voxel_thresh p < .05, one-tailed
cmap="RdBu_r",
symmetric_cbar=True,
vmax=4,
)
plt.show()
Expand Down
Loading

0 comments on commit d95c18b

Please sign in to comment.