Skip to content

Commit bb7de70

Browse files
authored
Merge pull request #55 from jnolan14/vglrun_opt
Added flag to Freeview to allow the user to skip the check to call FV with vglrun
2 parents ec5ddb1 + 65153e0 commit bb7de70

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

surfa/vis/freeview.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class Freeview:
1414

15-
def __init__(self, title=None, debug=False):
15+
def __init__(self, title=None, debug=False, use_vglrun=True):
1616
"""
1717
A visualization class that wraps the `freeview` command.
1818
@@ -31,6 +31,7 @@ def __init__(self, title=None, debug=False):
3131
self.debug = debug
3232
self.title = title
3333
self.isshown = False
34+
self.use_vglrun = use_vglrun
3435
self.arguments = []
3536

3637
# first check if freeview is even accessible
@@ -188,9 +189,10 @@ def show(self, background=True, threads=None):
188189

189190
# freeview can be buggy when run remotely, so let's test if VGL is
190191
# available to wrap the process
191-
vgl = _find_vgl()
192-
if vgl is not None:
193-
command = f'{vgl} {command}'
192+
if self.use_vglrun:
193+
vgl = _find_vgl()
194+
if vgl is not None:
195+
command = f'{vgl} {command}'
194196

195197
# set number of OMP threads if provided
196198
if threads is not None:

0 commit comments

Comments
 (0)