Skip to content

Commit 8e2167f

Browse files
committed
RF Use nibabel.freesurfer.read_ functions in test_viz and examples
1 parent 748b17f commit 8e2167f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/plot_foci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import os.path as op
1414
from numpy import arange
1515
from numpy.random import permutation
16+
import nibabel as nib
1617
from surfer import Brain
17-
from surfer import io
1818

1919
subject_id = "fsaverage"
2020
subjects_dir = os.environ["SUBJECTS_DIR"]
@@ -61,7 +61,7 @@
6161
and find 10 random vertices within the STS.
6262
"""
6363
annot_path = op.join(subjects_dir, subject_id, "label/lh.aparc.a2009s.annot")
64-
ids, ctab, names = io.read_annot(annot_path)
64+
ids, ctab, names = nib.freesurfer.read_annot(annot_path)
6565
verts = arange(0, len(ids))
6666
coords = permutation(verts[ids == 74])[:10]
6767

examples/plot_parc_values.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
import os
1313
import os.path as op
1414
import numpy as np
15-
from surfer import io, Brain
15+
import nibabel as nib
16+
from surfer import Brain
1617

1718
subject_id = "fsaverage"
1819
hemi = "lh"
@@ -31,7 +32,7 @@
3132
aparc_file = op.join(os.environ["SUBJECTS_DIR"],
3233
subject_id, "label",
3334
hemi + ".aparc.a2009s.annot")
34-
labels, ctab, names = io.read_annot(aparc_file)
35+
labels, ctab, names = nib.freesurfer.read_annot(aparc_file)
3536

3637
"""
3738
Make a random vector of scalar data corresponding to

surfer/tests/test_viz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from os.path import join as pjoin
44
from numpy.testing import assert_raises
55
from tempfile import mktemp
6+
import nibabel as nib
67

78
from surfer import Brain
89
from surfer import io
@@ -99,7 +100,7 @@ def test_foci():
99100
brain.add_foci(coords, map_surface="white", color="gold")
100101

101102
annot_path = pjoin(subj_dir, subject_id, 'label', 'lh.aparc.a2009s.annot')
102-
ids, ctab, names = io.read_annot(annot_path)
103+
ids, ctab, names = nib.freesurfer.read_annot(annot_path)
103104
verts = np.arange(0, len(ids))
104105
coords = np.random.permutation(verts[ids == 74])[:10]
105106
scale_factor = 0.7

0 commit comments

Comments
 (0)