Skip to content

Commit 100bb8e

Browse files
committed
ENH: Only write FLIRT log if not previously written
1 parent a63c52d commit 100bb8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,15 @@ class FLIRT(FSLCommand):
549549
_cmd = 'flirt'
550550
input_spec = FLIRTInputSpec
551551
output_spec = FLIRTOutputSpec
552+
_log_written = False
552553

553554
def aggregate_outputs(self, runtime=None, needed_outputs=None):
554555
outputs = super(FLIRT, self).aggregate_outputs(
555556
runtime=runtime, needed_outputs=needed_outputs)
556-
if isdefined(self.inputs.save_log) and self.inputs.save_log:
557+
if self.inputs.save_log and not self._log_written:
557558
with open(outputs.out_log, "a") as text_file:
558559
text_file.write(runtime.stdout + '\n')
560+
self._log_written = True
559561
return outputs
560562

561563
def _parse_inputs(self, skip=None):

0 commit comments

Comments
 (0)