@@ -185,6 +185,15 @@ class SurfaceAffineRegression(WBCommand):
185
185
warped source surface. Note that this has a bias to shrink the surface
186
186
that is being warped. The output is written as a NIFTI 'world' matrix,
187
187
see -convert-affine to convert it for use in other software.
188
+
189
+ >>> sar = SurfaceAffineRegression()
190
+ >>> sar.inputs.in_surface = 'sub-01_hemi-L_sulc.shape.gii'
191
+ >>> sar.inputs.target_surface = 'tpl-fsaverage_hemi-L_den-164k_sulc.shape.gii'
192
+ >>> sar.cmdline
193
+ 'wb_command -surface-affine-regression \
194
+ sub-01_hemi-L_sulc.shape.gii \
195
+ tpl-fsaverage_hemi-L_den-164k_sulc.shape.gii \
196
+ sub-01_hemi-L_sulc.shape_xfm'
188
197
"""
189
198
input_spec = SurfaceAffineRegressionInputSpec
190
199
output_spec = SurfaceAffineRegressionOutputSpec
@@ -250,6 +259,25 @@ class SurfaceApplyAffine(WBCommand):
250
259
represent. If the -flirt option is not present, the affine must be a
251
260
nifti 'world' affine, which can be obtained with the -convert-affine
252
261
command, or aff_conv from the 4dfp suite.
262
+
263
+ .. testsetup::
264
+
265
+ >>> np.savetxt('affine.txt', np.eye(4), delimiter='\t ')
266
+
267
+ .. doctest::
268
+
269
+ >>> saa = SurfaceApplyAffine()
270
+ >>> saa.inputs.in_surface = 'sub-01_hemi-L_sphere.surf.gii'
271
+ >>> saa.inputs.in_affine = 'affine.txt'
272
+ >>> saa.cmdline
273
+ 'wb_command -surface-apply-affine \
274
+ sub-01_hemi-L_sphere.surf.gii \
275
+ affine.txt \
276
+ sub-01_hemi-L_sphere.surf_xformed.surf.gii'
277
+
278
+ .. testcleanup::
279
+
280
+ >>> os.unlink('affine.txt')
253
281
"""
254
282
input_spec = SurfaceApplyAffineInputSpec
255
283
output_spec = SurfaceApplyAffineOutputSpec
@@ -309,6 +337,15 @@ class SurfaceApplyWarpfield(WBCommand):
309
337
If the -fnirt option is not present, the warpfield must be a nifti
310
338
'world' warpfield, which can be obtained with the -convert-warpfield
311
339
command.
340
+
341
+ >>> saw = SurfaceApplyWarpfield()
342
+ >>> saw.inputs.in_surface = 'sub-01_hemi-L_sphere.surf.gii'
343
+ >>> saw.inputs.warpfield = 'sub-01_desc-warped_T1w.nii.gz'
344
+ >>> saw.cmdline
345
+ 'wb_command -surface-apply-warpfield \
346
+ sub-01_hemi-L_sphere.surf.gii \
347
+ sub-01_desc-warped_T1w.nii.gz \
348
+ sub-01_hemi-L_sphere.surf_warped.surf.gii'
312
349
"""
313
350
input_spec = SurfaceApplyWarpfieldInputSpec
314
351
output_spec = SurfaceApplyWarpfieldOutputSpec
0 commit comments