@@ -338,40 +338,44 @@ class ApplyTransformsToPointsInputSpec(ANTSCommandInputSpec):
338
338
'specified, antsWarp tries to infer the '
339
339
'dimensionality from the input image.' ))
340
340
input_file = File (argstr = '--input %s' , mandatory = True ,
341
- desc = ('image to apply transformation to (generally a '
342
- 'coregistered functional)' ),
343
- exists = True )
341
+ desc = ("Currently, the only input supported is a csv file with "
342
+ "columns including x,y (2D), x,y,z (3D) or x,y,z,t,label (4D) column headers."
343
+ "The points should be defined in physical space."
344
+ "If in doubt how to convert coordinates from your files to the space"
345
+ "required by antsApplyTransformsToPoints try creating/drawing a simple"
346
+ "label volume with only one voxel set to 1 and all others set to 0."
347
+ "Write down the voxel coordinates. Then use ImageMaths LabelStats to find"
348
+ "out what coordinates for this voxel antsApplyTransformsToPoints is"
349
+ "expecting." ),
350
+ exists = True )
344
351
output_file = traits .Str (argstr = '--output %s' ,
345
- desc = ('output file name' ), name_source = ['input_file' ],
346
- hash_files = False , name_template = '%s_transformed.csv' )
347
- transforms = traits .List (
348
- File (exists = True ), argstr = '%s' , mandatory = True , desc = ('' ))
349
- invert_transform_flags = traits .List (traits .Bool ())
352
+ desc = ('Name of the output CSV file' ), name_source = ['input_file' ],
353
+ hash_files = False , name_template = '%s_transformed.csv' )
354
+ transforms = traits .List (File (exists = True ), argstr = '%s' , mandatory = True ,
355
+ desc = ('transforms that will be applied to the points' ))
356
+ invert_transform_flags = traits .List (traits .Bool (),
357
+ desc = ('list indicating if a transform should be reversed' ))
350
358
351
359
352
360
class ApplyTransformsToPointsOutputSpec (TraitedSpec ):
353
361
output_file = File (exists = True , desc = 'csv file with transformed coordinates' )
354
362
355
363
356
364
class ApplyTransformsToPoints (ANTSCommand ):
357
- """ApplyTransforms , applied to an input image , transforms it according to a
358
- reference image and a transform (or a set of transforms).
365
+ """ApplyTransformsToPoints , applied to an CSV file , transforms coordinates
366
+ using provided transform (or a set of transforms).
359
367
360
368
Examples
361
369
--------
362
370
363
371
>>> from nipype.interfaces.ants import ApplyTransforms
364
- >>> at = ApplyTransforms ()
372
+ >>> at = ApplyTransformsToPoints ()
365
373
>>> at.inputs.dimension = 3
366
- >>> at.inputs.input_image = 'moving1.nii'
367
- >>> at.inputs.reference_image = 'fixed1.nii'
368
- >>> at.inputs.output_image = 'deformed_moving1.nii'
369
- >>> at.inputs.interpolation = 'Linear'
370
- >>> at.inputs.default_value = 0
374
+ >>> at.inputs.input_file = 'moving.csv'
371
375
>>> at.inputs.transforms = ['trans.mat', 'ants_Warp.nii.gz']
372
376
>>> at.inputs.invert_transform_flags = [False, False]
373
377
>>> at.cmdline
374
- 'antsApplyTransforms --default-value 0 -- dimensionality 3 --input moving1.nii --interpolation Linear -- output deformed_moving1.nii --reference-image fixed1.nii --transform [trans.mat,0] --transform [ants_Warp.nii.gz,0]'
378
+ 'antsApplyTransformsToPoints --dimensionality 3 --input moving.csv --output moving_transformed.csv --transform [trans.mat,0] --transform [ants_Warp.nii.gz,0]'
375
379
376
380
377
381
"""
0 commit comments