Skip to content

Commit 07f4601

Browse files
Fix non mandatory output issue in DWIBiasCorrect
The function `_list_outputs` in `DWIBiasCorrect` doesn't take into account the fact that `output_file` is not a mandatory input, thus making any pipeline using this interface without specifying the output crash.
1 parent cf264ac commit 07f4601

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,12 @@ def _format_arg(self, name, trait_spec, value):
256256
return super()._format_arg(name, trait_spec, value)
257257

258258
def _list_outputs(self):
259-
outputs = self.output_spec().get()
260-
outputs["out_file"] = op.abspath(self.inputs.out_file)
261-
if self.inputs.bias:
262-
outputs["bias"] = op.abspath(self.inputs.bias)
263-
return outputs
259+
if self.inputs.out_file:
260+
outputs = self.output_spec().get()
261+
outputs["out_file"] = op.abspath(self.inputs.out_file)
262+
if self.inputs.bias:
263+
outputs["bias"] = op.abspath(self.inputs.bias)
264+
return outputs
264265

265266

266267
class DWIPreprocInputSpec(MRTrix3BaseInputSpec):

0 commit comments

Comments
 (0)