Skip to content

Commit 75cae9f

Browse files
committed
Prevent resume flags from clobbering explicit args
1 parent ee9fb50 commit 75cae9f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,16 +800,21 @@ def cmdline(self):
800800
directive = 'all'
801801
for idx, step in enumerate(self._steps):
802802
step, outfiles = step
803+
flag = '-{}'.format(step)
804+
noflag = '-no{}'.format(step)
805+
if flag in cmd or noflag in cmd:
806+
continue
807+
803808
if all([os.path.exists(os.path.join(subjects_dir,
804809
self.inputs.subject_id, f)) for
805810
f in outfiles]):
806-
flags.append('-no%s' % step)
811+
flags.append(noflag)
807812
if idx > 4:
808813
directive = 'autorecon2'
809814
elif idx > 23:
810815
directive = 'autorecon3'
811816
else:
812-
flags.append('-%s' % step)
817+
flags.append(flag)
813818
cmd = cmd.replace(' -%s ' % self.inputs.directive, ' -%s ' % directive)
814819
cmd += ' ' + ' '.join(flags)
815820
iflogger.info('resume recon-all : %s' % cmd)

0 commit comments

Comments
 (0)