Skip to content

Commit 3b78740

Browse files
committed
update check
1 parent 76cbf0f commit 3b78740

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

nipype/interfaces/ants/segmentation.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,14 @@ def _run_interface(self, runtime, correct_return_codes=(0,)):
710710
runtime = super(BrainExtraction, self)._run_interface(runtime)
711711

712712
# Still, double-check if it didn't found N4
713-
if 'we cant find the N4 program' in runtime.stdout:
714-
errmsg = ('antsBrainExtraction.sh requires the environment variable '
715-
'ANTSPATH to be defined')
713+
if 'we cant find' in runtime.stdout:
714+
for line in runtime.stdout.split('\n'):
715+
if line.strip().startswith('we cant find'):
716+
tool = line.strip().replace('we cant find the', '').split(' ')[0]
717+
break
718+
719+
errmsg = ('antsBrainExtraction.sh requires %s the environment variable '
720+
'ANTSPATH to be defined' % tool)
716721
if runtime.stderr is None:
717722
runtime.stderr = errmsg
718723
else:

0 commit comments

Comments
 (0)