cmtklib.interfaces.ants module

The ANTs module provides Nipype interfaces for the ANTs registration toolbox missing in nipype or modified.

MultipleANTsApplyTransforms

Link to code

Bases: nipype.interfaces.base.core.BaseInterface

Apply linear and deformable transforms estimated by ANTS to a list of images.

It calls the antsApplyTransform on a series of images.

Examples

>>> apply_tf = MultipleANTsApplyTransforms()
>>> apply_tf.inputs.input_images = ['/path/to/sub-01_atlas-L2018_desc-scale1_dseg.nii.gz',
>>>                                 '/path/to/sub-01_atlas-L2018_desc-scale2_dseg.nii.gz',
>>>                                 '/path/to/sub-01_atlas-L2018_desc-scale3_dseg.nii.gz',
>>>                                 '/path/to/sub-01_atlas-L2018_desc-scale4_dseg.nii.gz',
>>>                                 '/path/to/sub-01_atlas-L2018_desc-scale5_dseg.nii.gz']
>>> apply_tf.inputs.transforms = ['/path/to/final1Warp.nii.gz',
>>>                               '/path/to/final0GenericAffine.mat']
>>> apply_tf.inputs.reference_image = File(mandatory=True, exists=True)
>>> apply_tf.inputs.interpolation = 'NearestNeighbor'
>>> apply_tf.inputs.default_value = 0.0
>>> apply_tf.inputs.out_postfix = "_transformed"
>>> apply_tf.run() 

reference_image : a string or os.PathLike object referring to an existing file transforms : a list of items which are a string or os.PathLike object referring to an existing file

Transform files: will be applied in reverse order. For example, the last specified transform will be applied first.

default_value : a float input_images : a list of items which are a string or os.PathLike object referring to an existing file interpolation : ‘Linear’ or ‘NearestNeighbor’ or ‘CosineWindowedSinc’ or ‘WelchWindowedSinc’ or ‘HammingWindowedSinc’ or ‘LanczosWindowedSinc’ or ‘MultiLabel’ or ‘Gaussian’ or ‘BSpline’

(Nipype default value: Linear)

out_postfixa string

(Nipype default value: _transformed)

output_images : a list of items which are a string or os.PathLike object