6
6
# @Author: oesteban - code@oscaresteban.es
7
7
# @Date: 2014-06-02 12:06:50
8
8
# @Last Modified by: oesteban
9
- # @Last Modified time: 2014-06-17 10:19:23
9
+ # @Last Modified time: 2014-09-01 21:03:57
10
10
"""
11
11
Interfaces to perform image registrations and to apply the resulting
12
12
displacement maps to images and points.
18
18
19
19
from ..base import (CommandLine , CommandLineInputSpec , isdefined ,
20
20
TraitedSpec , File , traits , InputMultiPath )
21
-
22
-
23
21
from base import ElastixBaseInputSpec
24
22
25
23
from ... import logging
@@ -31,10 +29,8 @@ class RegistrationInputSpec(ElastixBaseInputSpec):
31
29
desc = 'fixed image' )
32
30
moving_image = File (exists = True , mandatory = True , argstr = '-m %s' ,
33
31
desc = 'moving image' )
34
-
35
32
parameters = InputMultiPath (File (exists = True ), mandatory = True , argstr = '-p %s...' ,
36
33
desc = 'parameter file, elastix handles 1 or more -p' )
37
-
38
34
fixed_mask = File (exists = True , argstr = '-fMask %s' , desc = 'mask for fixed image' )
39
35
moving_mask = File (exists = True , argstr = '-mMask %s' , desc = 'mask for moving image' )
40
36
initial_transform = File (exists = True , argstr = '-t0 %s' ,
@@ -51,7 +47,8 @@ class RegistrationOutputSpec(TraitedSpec):
51
47
52
48
53
49
class Registration (CommandLine ):
54
- """Elastix nonlinear registration interface
50
+ """
51
+ Elastix nonlinear registration interface
55
52
56
53
Example
57
54
-------
@@ -63,6 +60,8 @@ class Registration(CommandLine):
63
60
>>> reg.inputs.parameters = ['elastix.txt']
64
61
>>> reg.cmdline
65
62
'elastix -f fixed1.nii -m moving1.nii -out ./ -p elastix.txt'
63
+
64
+
66
65
"""
67
66
68
67
_cmd = 'elastix'
@@ -140,17 +139,21 @@ class ApplyWarpOutputSpec(TraitedSpec):
140
139
warped_file = File (desc = 'input moving image warped to fixed image' )
141
140
142
141
class 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.
144
144
The transform is specified in the transform-parameter file.
145
145
146
- Example::
146
+ Example
147
+ -------
147
148
148
149
>>> from nipype.interfaces.elastix import ApplyWarp
149
150
>>> reg = ApplyWarp()
150
151
>>> reg.inputs.moving_image = 'moving1.nii'
151
152
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
152
153
>>> reg.cmdline
153
154
'transformix -in moving1.nii -out ./ -tp TransformParameters.0.txt'
155
+
156
+
154
157
"""
155
158
156
159
_cmd = 'transformix'
@@ -170,22 +173,26 @@ class AnalyzeWarpInputSpec(ElastixBaseInputSpec):
170
173
171
174
172
175
class 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' )
176
179
177
180
class 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
179
183
the corresponding deformation field, generate the determinant of the
180
184
Jacobian map or the Jacobian map itself)
181
185
182
- Example::
186
+ Example
187
+ -------
183
188
184
189
>>> from nipype.interfaces.elastix import AnalyzeWarp
185
190
>>> reg = AnalyzeWarp()
186
191
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
187
192
>>> reg.cmdline
188
193
'transformix -def all -jac all -jacmat all -out ./ -tp TransformParameters.0.txt'
194
+
195
+
189
196
"""
190
197
191
198
_cmd = 'transformix -def all -jac all -jacmat all'
@@ -213,17 +220,20 @@ class PointsWarpOutputSpec(TraitedSpec):
213
220
warped_file = File (desc = 'input points displaced in fixed image domain' )
214
221
215
222
class 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.
217
224
The transform is specified in the transform-parameter file.
218
225
219
- Example::
226
+ Example
227
+ -------
220
228
221
229
>>> from nipype.interfaces.elastix import PointsWarp
222
230
>>> reg = PointsWarp()
223
231
>>> reg.inputs.points_file = 'surf1.vtk'
224
232
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
225
233
>>> reg.cmdline
226
234
'transformix -out ./ -def surf1.vtk -tp TransformParameters.0.txt'
235
+
236
+
227
237
"""
228
238
229
239
_cmd = 'transformix'
0 commit comments