Skip to content

Commit c2c7b04

Browse files
committed
Rename ApplyTransforms, dont import depracated interfaces
1 parent acb94da commit c2c7b04

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

nipype/interfaces/ants/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
# Registraiton programs
77
from .registration import ANTS, Registration
8-
# deprecated
9-
from .legacy import antsIntroduction, buildtemplateparallel
108

119
# Resampling Programs
1210
from resampling import ApplyTransforms, WarpImageMultiTransform, WarpTimeSeriesImageMultiTransform

nipype/interfaces/ants/registration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ class Registration(ANTSCommand):
249249
>>> reg.inputs.use_histogram_matching = [True, True] # This is the default
250250
>>> reg.inputs.output_warped_image = 't1_average_BRAINSABC_To_template_t1_clipped_INTERNAL_WARPED.nii.gz'
251251
>>> reg.cmdline
252-
'Registration --dimensionality 3 --initial-moving-transform [trans.mat,0] --output [t1_average_BRAINSABC_To_template_t1_clipped,t1_average_BRAINSABC_To_template_t1_clipped_INTERNAL_WARPED.nii.gz] --transform Affine[2.0] --metric Mattes[fixed1.nii,moving1.nii,1,32,Random,0.05] --convergence [1500x200,1e-08,20] --smoothing-sigmas 1x0 --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[0.25,3.0,0.0] --metric Mattes[fixed1.nii,moving1.nii,1,32] --convergence [100x50x30,1e-09,20] --smoothing-sigmas 2x1x0 --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --write-composite-transform 1'
252+
'antsRegistration --dimensionality 3 --initial-moving-transform [trans.mat,0] --output [t1_average_BRAINSABC_To_template_t1_clipped,t1_average_BRAINSABC_To_template_t1_clipped_INTERNAL_WARPED.nii.gz] --transform Affine[2.0] --metric Mattes[fixed1.nii,moving1.nii,1,32,Random,0.05] --convergence [1500x200,1e-08,20] --smoothing-sigmas 1x0 --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[0.25,3.0,0.0] --metric Mattes[fixed1.nii,moving1.nii,1,32] --convergence [100x50x30,1e-09,20] --smoothing-sigmas 2x1x0 --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --write-composite-transform 1'
253253
"""
254-
_cmd = 'Registration'
254+
_cmd = 'antsRegistration'
255255
input_spec = RegistrationInputSpec
256256
output_spec = RegistrationOutputSpec
257257

nipype/interfaces/ants/resampling.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def _list_outputs(self):
189189
return outputs
190190

191191

192-
class antsApplyTransformsInputSpec(ANTSCommandInputSpec):
192+
class ApplyTransformsInputSpec(ANTSCommandInputSpec):
193193
dimension = traits.Enum(3, 2, argstr='--dimensionality %d', usedefault=True,
194194
desc='image dimension (2 or 3)')
195195
input_image = File(argstr='--input %s', mandatory=True,
@@ -221,18 +221,18 @@ class antsApplyTransformsInputSpec(ANTSCommandInputSpec):
221221
default_value = traits.Int(argstr='--default-value %d', mandatory = True)
222222
print_out_composite_warp_file = traits.Enum(0, 1, requires=["output_image"], desc=('')) # TODO: Change to boolean
223223

224-
class antsApplyTransformsOutputSpec(TraitedSpec):
224+
class ApplyTransformsOutputSpec(TraitedSpec):
225225
output_image = File(exists=True, desc='Warped image')
226226

227-
class antsApplyTransforms(ANTSCommand):
228-
"""antsApplyTransforms, applied to an input image, transforms it according to a
227+
class ApplyTransforms(ANTSCommand):
228+
"""ApplyTransforms, applied to an input image, transforms it according to a
229229
reference image and a transform (or a set of transforms).
230230
231231
Examples
232232
--------
233233
234-
>>> from nipype.interfaces.ants import antsApplyTransforms
235-
>>> at = antsApplyTransforms()
234+
>>> from nipype.interfaces.ants import ApplyTransforms
235+
>>> at = ApplyTransforms()
236236
>>> at.inputs.dimension = 3
237237
>>> at.inputs.input_image = 'moving1.nii'
238238
>>> at.inputs.reference_image = 'fixed1.nii'
@@ -245,8 +245,8 @@ class antsApplyTransforms(ANTSCommand):
245245
246246
"""
247247
_cmd = 'antsApplyTransforms'
248-
input_spec = antsApplyTransformsInputSpec
249-
output_spec = antsApplyTransformsOutputSpec
248+
input_spec = ApplyTransformsInputSpec
249+
output_spec = ApplyTransformsOutputSpec
250250

251251
def _gen_filename(self, name):
252252
if name == 'output_image':
@@ -283,7 +283,7 @@ def _format_arg(self, opt, spec, val):
283283
elif opt == 'interpolation':
284284
# TODO: handle multilabel, gaussian, and bspline options
285285
return '--interpolation %s' % self.inputs.interpolation
286-
return super(antsApplyTransforms, self)._format_arg(opt, spec, val)
286+
return super(ApplyTransforms, self)._format_arg(opt, spec, val)
287287

288288
def _list_outputs(self):
289289
outputs = self._outputs().get()

0 commit comments

Comments
 (0)