Skip to content

Commit b64b44e

Browse files
committed
Merge pull request #905 from oesteban/fix/ElastixDocumentation
Fix elastix documentation
2 parents 3083f8d + ca60263 commit b64b44e

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

nipype/interfaces/elastix/registration.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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
"""
1111
Interfaces to perform image registrations and to apply the resulting
1212
displacement maps to images and points.
@@ -18,8 +18,6 @@
1818

1919
from ..base import (CommandLine, CommandLineInputSpec, isdefined,
2020
TraitedSpec, File, traits, InputMultiPath)
21-
22-
2321
from base import ElastixBaseInputSpec
2422

2523
from ... 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

5349
class 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

142141
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.
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

172175
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')
176179

177180
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
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

215222
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.
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'

nipype/interfaces/elastix/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# @Author: oesteban - code@oscaresteban.es
77
# @Date: 2014-06-17 10:17:07
88
# @Last Modified by: oesteban
9-
# @Last Modified time: 2014-06-27 10:25:36
9+
# @Last Modified time: 2014-09-01 21:05:33
1010
"""
1111
Generic interfaces to manipulate registration parameters files, including
1212
transform files (to configure warpings)
@@ -51,14 +51,17 @@ class EditTransform(BaseInterface):
5151
"""
5252
Manipulates an existing transform file generated with elastix
5353
54-
Example::
54+
Example
55+
-------
5556
5657
>>> from nipype.interfaces.elastix import EditTransform
5758
>>> tfm = EditTransform()
5859
>>> tfm.inputs.transform_file = 'TransformParameters.0.txt'
5960
>>> tfm.inputs.reference_image = 'fixed1.nii'
6061
>>> tfm.inputs.output_type = 'unsigned char'
6162
>>> tfm.run() # doctest: +SKIP
63+
64+
6265
"""
6366

6467
input_spec = EditTransformInputSpec

0 commit comments

Comments
 (0)