MCPcopy Index your code
hub / github.com/danjgale/surfplot / load_example_data

Function load_example_data

surfplot/datasets.py:8–46  ·  view source on GitHub ↗

Load example datasets for tutorials Precomputed association maps for terms 'default mode' or 'frontoparietal' using Neurosynth. In brief, maps were downloaded from Neurosynth and projected to fsLR space using ``neuromaps.transforms.mni152_to_fslr``. Then, their vertex arrays were s

(dataset='default_mode', join=False)

Source from the content-addressed store, hash-verified

6DATA = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data'))
7
8def load_example_data(dataset='default_mode', join=False):
9 """Load example datasets for tutorials
10
11 Precomputed association maps for terms 'default mode' or 'frontoparietal'
12 using Neurosynth. In brief, maps were downloaded from Neurosynth and
13 projected to fsLR space using ``neuromaps.transforms.mni152_to_fslr``.
14 Then, their vertex arrays were saved.
15
16 1. Default mode: https://www.neurosynth.org/analyses/terms/default%20mode/
17 2. Frontoparietal: https://www.neurosynth.org/analyses/terms/frontoparietal/
18
19 Yarkoni T, Poldrack RA, Nichols TE, Van Essen DC, Wager TD. 2011.
20 Large-scale automated synthesis of human functional neuroimaging data.
21 Nat Methods. 8:665–670.
22
23 Parameters
24 ----------
25 dataset : {'default_mode', 'frontoparietal'}, optional
26 Neurosynth association map. Default: 'default_mode'
27 join : bool, optional
28 Return data as a single concatenated array. Default: False, which
29 returns left and right hemisphere arrays, respectively
30
31 Returns
32 -------
33 numpy.ndarray
34 Vertex array(s)
35 """
36 if dataset not in ['default_mode', 'frontoparietal']:
37 raise ValueError("dataset must be one 'default_mode' or "
38 "'frontoparietal'")
39
40 lh = np.loadtxt(os.path.join(DATA, f'lh_{dataset}_example.tsv'))
41 rh = np.loadtxt(os.path.join(DATA, f'rh_{dataset}_example.tsv'))
42
43 if join:
44 return np.concatenate([lh, rh])
45 else:
46 return lh, rh

Callers 8

plot_example_01.pyFile · 0.90
plot_example_01.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected