From 86cf4acdc969a47d5ad8d738925e1742457e4374 Mon Sep 17 00:00:00 2001 From: Wu Jianxiao Date: Mon, 26 Jun 2023 15:35:29 +0200 Subject: [PATCH 1/4] 'fsl_out' and 'lta_out' options in TKregister2 should check and add arguments with 'fsl_file' and 'lta_file' respectively --- nipype/interfaces/freesurfer/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 921bb7488f..08d2fc7ab3 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -1967,8 +1967,14 @@ def _format_arg(self, name, spec, value): if name == "lta_in" and self.inputs.invert_lta_in: spec = "--lta-inv %s" if name in ("fsl_out", "lta_out") and value is True: - value = self._list_outputs()[name] - return super(Tkregister2, self)._format_arg(name, spec, value) + if name == 'fsl_out': + name_actual = 'fsl_file' + if name == 'lta_out': + name_actual = 'lta_file' + value = self._list_outputs()[name_actual] + return super(Tkregister2, self)._format_arg(name_actual, spec, value) + else: + return super(Tkregister2, self)._format_arg(name, spec, value) def _list_outputs(self): outputs = self._outputs().get() From bf4bdcb7a41a4c3f4cbd614df5b71b30f8c703c6 Mon Sep 17 00:00:00 2001 From: Wu Jianxiao Date: Mon, 26 Jun 2023 15:46:58 +0200 Subject: [PATCH 2/4] Add contribution --- .zenodo.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index 0e13435cd8..e5d86d2c43 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -895,7 +895,12 @@ "affiliation": "University of Tübingen and MPI for Biological Cybernertics", "name": "Bannert, Michael M.", "orcid": "0000-0003-1010-7517" - } + }, + { + "affiliation": "Research Centre Juelich", + "name": "Jianxiao Wu", + "orcid": "0000-0002-4866-272X", + }, ], "keywords": [ "neuroimaging", From 9e57827c3eb3c9d1c948f540871963e0e9591d92 Mon Sep 17 00:00:00 2001 From: Wu Jianxiao Date: Mon, 26 Jun 2023 17:44:10 +0200 Subject: [PATCH 3/4] Simplify fix for Tkregister2._format_arg Co-authored-by: Chris Markiewicz --- nipype/interfaces/freesurfer/utils.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 08d2fc7ab3..0f809b4106 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -1967,14 +1967,8 @@ def _format_arg(self, name, spec, value): if name == "lta_in" and self.inputs.invert_lta_in: spec = "--lta-inv %s" if name in ("fsl_out", "lta_out") and value is True: - if name == 'fsl_out': - name_actual = 'fsl_file' - if name == 'lta_out': - name_actual = 'lta_file' - value = self._list_outputs()[name_actual] - return super(Tkregister2, self)._format_arg(name_actual, spec, value) - else: - return super(Tkregister2, self)._format_arg(name, spec, value) + value = self._list_outputs()[f'{name[:3]}_file'] + return super()._format_arg(name, spec, value) def _list_outputs(self): outputs = self._outputs().get() From c515dc002ac23988854247d00b5e92eaba932edd Mon Sep 17 00:00:00 2001 From: Wu Jianxiao Date: Wed, 5 Jul 2023 16:43:33 +0200 Subject: [PATCH 4/4] Update .zenodo.json --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index e5d86d2c43..8d98916d48 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -898,7 +898,7 @@ }, { "affiliation": "Research Centre Juelich", - "name": "Jianxiao Wu", + "name": "Wu, Jianxiao", "orcid": "0000-0002-4866-272X", }, ],