In [1]:
import os
import nilearn
import nilearn.datasets
import nilearn.plotting
from repo2data.repo2data import Repo2Data
import warnings

warnings.filterwarnings('ignore')
/home/ltetrel/.local/lib/python3.6/site-packages/nilearn/datasets/__init__.py:89: FutureWarning: Fetchers from the nilearn.datasets module will be updated in version 0.9 to return python strings instead of bytes and Pandas dataframes instead of Numpy arrays.
  "Numpy arrays.", FutureWarning)
In [2]:
# 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()
---- repo2data starting ----
/home/ltetrel/.local/lib/python3.6/site-packages/repo2data
Config from file :
../binder/data_requirement.json
Destination:
./../data/nilearn_neurovault

Info : ./../data/nilearn_neurovault already downloaded
In [3]:
# get the nilearn dataset instance
motor_images = nilearn.datasets.fetch_neurovault_motor_task(data_dir=data_path[0])
stat_img = motor_images.images[0]
In [4]:
# plot the func image
nilearn.plotting.plot_glass_brain(stat_img, threshold=3)
Out[4]:
<nilearn.plotting.displays.OrthoProjector at 0x7f0100a179b0>