import os
import nilearn
import nilearn.datasets
import nilearn.plotting
from repo2data.repo2data import Repo2Data
import warnings
warnings.filterwarnings('ignore')
# install the data if running locally, or points to cached data if running on neurolibre
data_req_path = os.path.join("..", "binder", "data_requirement.json")
# download data
repo2data = Repo2Data(data_req_path)
data_path = repo2data.install()
# get the nilearn dataset instance
motor_images = nilearn.datasets.fetch_neurovault_motor_task(data_dir=data_path[0])
stat_img = motor_images.images[0]
# plot the func image
nilearn.plotting.plot_glass_brain(stat_img, threshold=3)