Note

The NiMARE NeuroLibre preprint is a valuable resource that provides examples on how to utilize the package. However, it is important to note that this publication is static and will not be updated as NiMARE evolves. Despite potential changes to the syntax of the code, the publication remains an excellent reference to understand the various applications of NiMARE.

NeuroLibre Jupyter Book Link

Examples

Most examples have a launch JupyterLite button at the bottom of the page, which opens the example as a notebook that runs in your browser, with nothing to install. The first imports take about half a minute, and the analyses run a few times slower than they would on your own machine. Examples that download data from other sites, or that need PyTorch, XGBoost or pyarrow, don’t have the button.

Working with studysets

NiMARE’s primary collection type is now Studyset. Studysets can be used directly with estimators, workflows, and several transformers, while the legacy Dataset class remains available for backwards compatibility and migration workflows.

Additionally, NiMARE contains fetching and conversion tools for a number of meta-analytic resources, including NeuroStore, Neurosynth, NeuroQuery, NeuroVault, and, to a limited extent, BrainMap. For coordinate data, prefer fetch_neurostore(): it downloads a NeuroStore studyset release, which is rebuilt from the live database, while the Neurosynth and NeuroQuery fetchers download frozen snapshots and fetch_neurosynth is deprecated. In the examples below, we show how to work with Studysets in NiMARE, along with legacy Dataset-specific examples for interoperability and migration.

The legacy NiMARE Dataset object

The legacy NiMARE Dataset object

Neurosynth and NeuroQuery

Neurosynth and NeuroQuery

Use NeuroVault statistical maps in NiMARE

Use NeuroVault statistical maps in NiMARE

Transform images into coordinates

Transform images into coordinates

The NiMARE Studyset object

The NiMARE Studyset object

Create a legacy NiMARE Dataset object from a JSON file

Create a legacy NiMARE Dataset object from a JSON file

Loading Studysets from parquet

Loading Studysets from parquet.

Download NeuroStore coordinates

Download NeuroStore coordinates

Performing meta-analyses

NiMARE implements a number of coordinate- and image-based meta-analysis algorithms in its meta module. The examples below use Studyset as the primary analysis input, with legacy Dataset objects appearing only in preprocessing steps where older APIs still require them.

For more information about the components that go into coordinate-based meta-analyses in NiMARE, see Coordinate-based meta-analysis in NiMARE, as well as Outputs of NiMARE.

Coordinate-based meta-analysis algorithms

Coordinate-based meta-analysis algorithms

Image-based meta-analysis algorithms

Image-based meta-analysis algorithms

KernelTransformers and CBMA

KernelTransformers and CBMA

The Estimator class

The Estimator class

The Corrector class

The Corrector class

Compare image and coordinate based meta-analyses

Compare image and coordinate based meta-analyses

Meta-analytic coactivation modeling analysis

Meta-analytic coactivation modeling analysis

Two-sample ALE meta-analysis

Two-sample ALE meta-analysis

Simulate data for coordinate based meta-analysis

Simulate data for coordinate based meta-analysis

Run a coordinate-based meta-analysis (CBMA) workflow

Run a coordinate-based meta-analysis (CBMA) workflow

Coordinate-based meta-regression with a model formula

Coordinate-based meta-regression with a model formula

Run an image-based meta-analysis (IBMA) workflow

Run an image-based meta-analysis (IBMA) workflow

Qualitative interpretation of ALE statistic maps

Qualitative interpretation of ALE statistic maps

Comparing ALE-based pairwise contrast strategies

Comparing ALE-based pairwise contrast strategies

Predictive ALE: fast FWE correction without Monte Carlo

Predictive ALE: fast FWE correction without Monte Carlo

Stability diagnostics: Jackknife vs. ResampledStability

Stability diagnostics: Jackknife vs. ResampledStability

Sample-size weighting in MKDA

Sample-size weighting in MKDA

Annotating Studysets

Annotation tools within NiMARE (annotate) refer to methods which assign labels to analyses in a Studyset, generally based on text.

Simple annotation from text

Simple annotation from text

The Cognitive Atlas

The Cognitive Atlas

LDA topic modeling

LDA topic modeling

GCLDA topic modeling

GCLDA topic modeling

Decoding ROIs and images

Functional characterization analysis refers to methods which use meta-analytic databases to characterize, or “decode”, brain regions or statistical maps in terms of tasks and/or mental processes. For more information about functional characterization analysis, see Meta-analytic functional decoding.

Discrete functional decoding

Discrete functional decoding

Machine learning with Studysets

NiMARE’s machine-learning tools convert Studyset objects into scikit-learn-compatible bunches. The example below builds modeled activation features, splits analyses so each study stays on one side, reduces the voxelwise features, and fits a downstream estimator.

Machine learning in NiMARE

Machine learning in NiMARE

Gallery generated by Sphinx-Gallery