Skip to content

Commit 3137e98

Browse files
ENH Brain.add_label(): find labels in subfolder
1 parent e467ade commit 3137e98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

surfer/viz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,10 +1026,11 @@ def add_label(self, label, color="crimson", alpha=1,
10261026
filepath = label
10271027
label_name = os.path.basename(filepath).split('.')[1]
10281028
else:
1029-
label_name = label
1029+
dirname, label_name = os.path.split(label)
10301030
filepath = pjoin(self.subjects_dir,
10311031
self.subject_id,
10321032
'label',
1033+
dirname,
10331034
".".join([hemi, label_name, 'label']))
10341035
if not os.path.exists(filepath):
10351036
raise ValueError('Label file %s does not exist'

0 commit comments

Comments
 (0)