Skip to content

Commit e18513e

Browse files
committed
Remove faulty directive overrides
Assuming any directive maps to '-all' with all previous steps completed is incorrect. Further, the directive update to 'autorecon2' precludes the completion of 'autorecon3', which 'all' includes. Taking the existing directive and removing completed steps is a more conservative approach, with less chance of unexpected behavior.
1 parent 27f8bd1 commit e18513e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,8 @@ def cmdline(self):
793793
subjects_dir = self.inputs.subjects_dir
794794
if not isdefined(subjects_dir):
795795
subjects_dir = self._gen_subjects_dir()
796-
# cmd = cmd.replace(' -all ', ' -make all ')
797-
iflogger.info('Overriding recon-all directive')
796+
798797
flags = []
799-
directive = 'all'
800798
for idx, step in enumerate(self._steps):
801799
step, outfiles, infiles = step
802800
flag = '-{}'.format(step)
@@ -808,14 +806,8 @@ def cmdline(self):
808806
if check_depends([os.path.join(subj_dir, f) for f in outfiles],
809807
[os.path.join(subj_dir, f) for f in infiles]):
810808
flags.append(noflag)
811-
if idx > 4:
812-
directive = 'autorecon2'
813-
elif idx > 23:
814-
directive = 'autorecon3'
815-
else:
816-
flags.append(flag)
817-
cmd = cmd.replace(' -%s ' % self.inputs.directive, ' -%s ' % directive)
818809
cmd += ' ' + ' '.join(flags)
810+
819811
iflogger.info('resume recon-all : %s' % cmd)
820812
return cmd
821813

0 commit comments

Comments
 (0)