Skip to content

Commit 8fc9a12

Browse files
committed
allows X coordinate offset to be disabled
1 parent 7faeabc commit 8fc9a12

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

surfer/viz.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ class Brain(object):
317317
variable.
318318
views : list | str
319319
views to use
320+
disable_offset : bool
321+
If True, disables alignment of origin with medial wall, instead
322+
make no change to surface coordinates. Useful to overlay additional
323+
visualizations (i.e. subcortical) onto same mayavi figure.
320324
show_toolbar : bool
321325
If True, toolbars will be shown for each view.
322326
offscreen : bool
@@ -333,8 +337,8 @@ class Brain(object):
333337
def __init__(self, subject_id, hemi, surf, curv=True, title=None,
334338
cortex="classic", size=800, background="black",
335339
foreground="white", figure=None, subjects_dir=None,
336-
views=['lat'], show_toolbar=False, offscreen=False,
337-
config_opts=None):
340+
views=['lat'], disable_offset=False, show_toolbar=False,
341+
offscreen=False, config_opts=None):
338342

339343
# Keep backwards compatability
340344
if config_opts is not None:
@@ -370,7 +374,7 @@ def __init__(self, subject_id, hemi, surf, curv=True, title=None,
370374
n_row = len(views)
371375

372376
# load geometry for one or both hemispheres as necessary
373-
offset = None if hemi != 'both' else 0.0
377+
offset = None if (disable_offset or hemi != 'both') else 0.0
374378
self.geo = dict()
375379
if hemi in ['split', 'both']:
376380
geo_hemis = ['lh', 'rh']

0 commit comments

Comments
 (0)