From 7963e31e998e219cfcdf06645a453fcdea56dd52 Mon Sep 17 00:00:00 2001 From: oesteban Date: Fri, 13 Mar 2020 21:52:00 -0700 Subject: [PATCH] FIX: Partial rollback of N4BiasFieldCorrection In the last maintenance (#3180) of the interface, we eliminated an important section of the ``_list_outputs``: https://github.com/nipy/nipype/commit/6979cbdcb041cb12b064513a57ff74b000bacdad#diff-b6f33a19b0e06b91023416db5faf7323L544-L547 This PR addresses the problem: ``` Execution Outputs ----------------- * bias_image : * output_image : /home/oesteban/tmp/fmriprep-ds005/fprep-work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/brain_extraction_wf/inu_n4_final/mapflow/_inu_n4_final0/sub-01_T1w_cor rected.nii.gz Runtime info ------------ * cmdline : N4BiasFieldCorrection --bspline-fitting [ 200 ] -d 3 --input-image /oak/stanford/groups/russpold/data/openfmri/ds000005/sub-01/anat/sub-01_T1w.nii.gz --convergence [ 50x 50x50x50x50, 1e-07 ] --output [ sub-01_T1w_corrected.nii.gz, sub-01_T1w_bias.nii.gz ] -r --shrink-factor 4 --weight-image /home/oesteban/tmp/fmriprep-ds005/fprep-work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/brain_extraction_wf/atropos_wf/copy_xform/09_relabel_wm_maths_xform.nii.gz * duration : 15.334786 * hostname : dendrite * prev_wd : /home/oesteban/tmp/fmriprep-ds005 * working_dir : /home/oesteban/tmp/fmriprep-ds005/fprep-work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/brain_extraction_wf/inu_n4_final/mapflow/_inu_n4_final0 ``` (`bias_image` should be `'sub-01_T1w_bias.nii.gz'` given the `cmdline`) --- nipype/interfaces/ants/segmentation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index d3319010d1..387fd229a1 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -537,6 +537,11 @@ def _parse_inputs(self, skip=None): self._out_bias_file = bias_image return super(N4BiasFieldCorrection, self)._parse_inputs(skip=skip) + def _list_outputs(self): + outputs = super(N4BiasFieldCorrection, self)._list_outputs() + if self._out_bias_file: + outputs["bias_image"] = os.path.abspath(self._out_bias_file) + return outputs class CorticalThicknessInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(