|
6 | 6 | # @Author: oesteban - [email protected]
|
7 | 7 | # @Date: 2014-06-02 12:06:50
|
8 | 8 | # @Last Modified by: oesteban
|
9 |
| -# @Last Modified time: 2014-06-03 14:17:08 |
| 9 | +# @Last Modified time: 2014-06-03 15:30:38 |
10 | 10 | """The :py:mod:`nipype.interfaces.elastix` provides the interface to
|
11 | 11 | the elastix registration software.
|
12 | 12 |
|
@@ -162,6 +162,43 @@ class ApplyWarp(CommandLine):
|
162 | 162 | def _list_outputs(self):
|
163 | 163 | outputs = self._outputs().get()
|
164 | 164 | out_dir = op.abspath(self.inputs.output_path)
|
165 |
| - outputs['out_file'] = op.join(out_dir,'result.nii.gz') |
| 165 | + outputs['warped_file'] = op.join(out_dir,'result.nii.gz') |
166 | 166 | return outputs
|
167 | 167 |
|
| 168 | + |
| 169 | +class AnalyzeWarpInputSpec(ElastixBaseInputSpec): |
| 170 | + transform_file = File(exists=True, mandatory=True, argstr='-tp %s', |
| 171 | + desc='transform-parameter file, only 1') |
| 172 | + |
| 173 | + |
| 174 | +class AnalyzeWarpOutputSpec(TraitedSpec): |
| 175 | + disp_field = File(exists=True, desc='displacements field') |
| 176 | + jacdet_map = File(exists=True, desc='det(Jacobian) map') |
| 177 | + jacmat_map = File(exists=True, desc='Jacobian matrix map') |
| 178 | + |
| 179 | +class AnalyzeWarp(CommandLine): |
| 180 | + """Use `transformix` to get details from the input transform (generate |
| 181 | + the corresponding deformation field, generate the determinant of the |
| 182 | + Jacobian map or the Jacobian map itself) |
| 183 | +
|
| 184 | + Example:: |
| 185 | +
|
| 186 | + >>> from nipype.interfaces.elastix import ApplyWarp |
| 187 | + >>> reg = ApplyWarp() |
| 188 | + >>> reg.inputs.moving_image = 'moving1.nii' |
| 189 | + >>> reg.inputs.transform_file = 'TransformParameters.0.txt' |
| 190 | + >>> reg.cmdline |
| 191 | + 'transformix -def all -jac all -jacmat all -out ./ -tp TransformParameters.0.txt' |
| 192 | + """ |
| 193 | + |
| 194 | + _cmd = 'transformix -def all -jac all -jacmat all' |
| 195 | + input_spec = AnalyzeWarpInputSpec |
| 196 | + output_spec = AnalyzeWarpOutputSpec |
| 197 | + |
| 198 | + def _list_outputs(self): |
| 199 | + outputs = self._outputs().get() |
| 200 | + out_dir = op.abspath(self.inputs.output_path) |
| 201 | + outputs['disp_field'] = op.join(out_dir,'deformationField.nii.gz') |
| 202 | + outputs['jacdet_map'] = op.join(out_dir,'spatialJacobian.nii.gz') |
| 203 | + outputs['jacmat_map'] = op.join(out_dir,'fullSpatialJacobian.nii.gz') |
| 204 | + return outputs |
0 commit comments