Skip to content

Commit 9fcef7c

Browse files
committed
Merge pull request #1009 from lsqshr/antsIntroduction_optional_outputs
ENH: antsIntroduction handles RA and RI transformations
2 parents 9fa2a32 + b92de07 commit 9fcef7c

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Next release
22
============
3-
3+
* ENH: Updated antsIntroduction to handle RA and RI registrations (https://github.com/nipy/nipype/pull/1009)
44
* ENH: Updated N4BiasCorrection input spec to include weight image and spline order. Made
55
argument formatting consistent. Cleaned ants.segmentation according to PEP8.
66
(https://github.com/nipy/nipype/pull/990/files)

nipype/interfaces/ants/legacy.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,21 @@ class antsIntroduction(ANTSCommand):
9494

9595
def _list_outputs(self):
9696
outputs = self._outputs().get()
97+
transmodel = self.inputs.transformation_model
98+
99+
# When transform is set as 'RI'/'RA', wrap fields should not be expected
100+
# The default transformation is GR, which outputs the wrap fields
101+
if not isdefined(transmodel) or (isdefined(transmodel) and transmodel not in ['RI', 'RA']):
102+
outputs['warp_field'] = os.path.join(os.getcwd(),
103+
self.inputs.out_prefix +
104+
'Warp.nii.gz')
105+
outputs['inverse_warp_field'] = os.path.join(os.getcwd(),
106+
self.inputs.out_prefix +
107+
'InverseWarp.nii.gz')
97108

98109
outputs['affine_transformation'] = os.path.join(os.getcwd(),
99110
self.inputs.out_prefix +
100111
'Affine.txt')
101-
outputs['warp_field'] = os.path.join(os.getcwd(),
102-
self.inputs.out_prefix +
103-
'Warp.nii.gz')
104-
outputs['inverse_warp_field'] = os.path.join(os.getcwd(),
105-
self.inputs.out_prefix +
106-
'InverseWarp.nii.gz')
107112
outputs['input_file'] = os.path.join(os.getcwd(),
108113
self.inputs.out_prefix +
109114
'repaired.nii.gz')

0 commit comments

Comments
 (0)