Using NIMADS with NiMARE

How to use the NeuroImaging Meta-Analysis Data Structure (NIMADS) with NiMARE.

from requests import request

from nimare.io import convert_nimads_to_dataset
from nimare.nimads import Studyset

Download Data from NeuroStore

def download_file(url):
    """Download a file from NeuroStore."""
    response = request("GET", url)
    return response.json()


nimads_studyset = download_file("https://neurostore.org/api/studysets/Cv2LLUqG76W9?nested=true")
nimads_annotation = download_file("https://neurostore.org/api/annotations/76PyNqoTNEsE")

Load Data

Load the json files into a NiMADS Studyset object.

Convert to NiMARE Dataset

Convert the NiMADS Studyset object to a NiMARE Dataset object. Then you can run NiMARE analyses on the Dataset object.

id study_id contrast_id x y z space
113 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls -10.0 -8.0 56.0 None
111 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 16.0 -70.0 44.0 None
112 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 32.0 -52.0 44.0 None
114 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 18.0 -4.0 56.0 None
115 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls -40.0 -32.0 40.0 None


Directly to NiMARE Dataset

Alternatively, you can convert the NiMADS json files directly to a NiMARE Dataset object if you wish to skip using the nimads studyset object directly.

id study_id contrast_id x y z space
113 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls -10.0 -8.0 56.0 None
111 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 16.0 -70.0 44.0 None
112 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 32.0 -52.0 44.0 None
114 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls 18.0 -4.0 56.0 None
115 A_PET_study_of_sequential_finger_movements_of_... A_PET_study_of_sequential_finger_movements_of_... Sequence-16_vs_Rest,_controls -40.0 -32.0 40.0 None


Total running time of the script: (0 minutes 0.812 seconds)

Gallery generated by Sphinx-Gallery