66# @Author: oesteban - code@oscaresteban.es
77# @Date: 2014-06-02 12:06:50
88# @Last Modified by: oesteban
9- # @Last Modified time: 2014-06-17 10:19:23
9+ # @Last Modified time: 2014-09-01 21:03:57
1010"""
1111Interfaces to perform image registrations and to apply the resulting
1212displacement maps to images and points.
1818
1919from ..base import (CommandLine , CommandLineInputSpec , isdefined ,
2020 TraitedSpec , File , traits , InputMultiPath )
21-
22-
2321from base import ElastixBaseInputSpec
2422
2523from ... import logging
@@ -31,10 +29,8 @@ class RegistrationInputSpec(ElastixBaseInputSpec):
3129 desc = 'fixed image' )
3230 moving_image = File (exists = True , mandatory = True , argstr = '-m %s' ,
3331 desc = 'moving image' )
34-
3532 parameters = InputMultiPath (File (exists = True ), mandatory = True , argstr = '-p %s...' ,
3633 desc = 'parameter file, elastix handles 1 or more -p' )
37-
3834 fixed_mask = File (exists = True , argstr = '-fMask %s' , desc = 'mask for fixed image' )
3935 moving_mask = File (exists = True , argstr = '-mMask %s' , desc = 'mask for moving image' )
4036 initial_transform = File (exists = True , argstr = '-t0 %s' ,
@@ -51,7 +47,8 @@ class RegistrationOutputSpec(TraitedSpec):
5147
5248
5349class Registration (CommandLine ):
54- """Elastix nonlinear registration interface
50+ """
51+ Elastix nonlinear registration interface
5552
5653 Example
5754 -------
@@ -63,6 +60,8 @@ class Registration(CommandLine):
6360 >>> reg.inputs.parameters = ['elastix.txt']
6461 >>> reg.cmdline
6562 'elastix -f fixed1.nii -m moving1.nii -out ./ -p elastix.txt'
63+
64+
6665 """
6766
6867 _cmd = 'elastix'
@@ -140,17 +139,21 @@ class ApplyWarpOutputSpec(TraitedSpec):
140139 warped_file = File (desc = 'input moving image warped to fixed image' )
141140
142141class ApplyWarp (CommandLine ):
143- """Use `transformix` to apply a transform on an input image.
142+ """
143+ Use ``transformix`` to apply a transform on an input image.
144144 The transform is specified in the transform-parameter file.
145145
146- Example::
146+ Example
147+ -------
147148
148149 >>> from nipype.interfaces.elastix import ApplyWarp
149150 >>> reg = ApplyWarp()
150151 >>> reg.inputs.moving_image = 'moving1.nii'
151152 >>> reg.inputs.transform_file = 'TransformParameters.0.txt'
152153 >>> reg.cmdline
153154 'transformix -in moving1.nii -out ./ -tp TransformParameters.0.txt'
155+
156+
154157 """
155158
156159 _cmd = 'transformix'
@@ -170,22 +173,26 @@ class AnalyzeWarpInputSpec(ElastixBaseInputSpec):
170173
171174
172175class AnalyzeWarpOutputSpec (TraitedSpec ):
173- disp_field = File (exists = True , desc = 'displacements field' )
174- jacdet_map = File (exists = True , desc = 'det(Jacobian) map' )
175- jacmat_map = File (exists = True , desc = 'Jacobian matrix map' )
176+ disp_field = File (desc = 'displacements field' )
177+ jacdet_map = File (desc = 'det(Jacobian) map' )
178+ jacmat_map = File (desc = 'Jacobian matrix map' )
176179
177180class AnalyzeWarp (CommandLine ):
178- """Use `transformix` to get details from the input transform (generate
181+ """
182+ Use transformix to get details from the input transform (generate
179183 the corresponding deformation field, generate the determinant of the
180184 Jacobian map or the Jacobian map itself)
181185
182- Example::
186+ Example
187+ -------
183188
184189 >>> from nipype.interfaces.elastix import AnalyzeWarp
185190 >>> reg = AnalyzeWarp()
186191 >>> reg.inputs.transform_file = 'TransformParameters.0.txt'
187192 >>> reg.cmdline
188193 'transformix -def all -jac all -jacmat all -out ./ -tp TransformParameters.0.txt'
194+
195+
189196 """
190197
191198 _cmd = 'transformix -def all -jac all -jacmat all'
@@ -213,17 +220,20 @@ class PointsWarpOutputSpec(TraitedSpec):
213220 warped_file = File (desc = 'input points displaced in fixed image domain' )
214221
215222class PointsWarp (CommandLine ):
216- """Use `transformix` to apply a transform on an input point set.
223+ """Use `` transformix` ` to apply a transform on an input point set.
217224 The transform is specified in the transform-parameter file.
218225
219- Example::
226+ Example
227+ -------
220228
221229 >>> from nipype.interfaces.elastix import PointsWarp
222230 >>> reg = PointsWarp()
223231 >>> reg.inputs.points_file = 'surf1.vtk'
224232 >>> reg.inputs.transform_file = 'TransformParameters.0.txt'
225233 >>> reg.cmdline
226234 'transformix -out ./ -def surf1.vtk -tp TransformParameters.0.txt'
235+
236+
227237 """
228238
229239 _cmd = 'transformix'
0 commit comments