interfaces.ants.utils¶
AffineInitializer¶
Wraps the executable command antsAffineInitializer
.
Initialize an affine transform (as in antsBrainExtraction.sh)
>>> from nipype.interfaces.ants import AffineInitializer
>>> init = AffineInitializer()
>>> init.inputs.fixed_image = 'fixed1.nii'
>>> init.inputs.moving_image = 'moving1.nii'
>>> init.cmdline
'antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10'
Inputs:
[Mandatory]
fixed_image: (a pathlike object or string representing an existing
file)
reference image
argument: ``%s``, position: 1
moving_image: (a pathlike object or string representing an existing
file)
moving image
argument: ``%s``, position: 2
[Optional]
dimension: (3 or 2, nipype default value: 3)
dimension
argument: ``%s``, position: 0
out_file: (a pathlike object or string representing a file, nipype
default value: transform.mat)
output transform file
argument: ``%s``, position: 3
search_factor: (a float, nipype default value: 15.0)
increments (degrees) for affine search
argument: ``%f``, position: 4
radian_fraction: (0.0 <= a floating point number <= 1.0, nipype
default value: 0.1)
search this arc +/- principal axes
argument: ``%f``, position: 5
principal_axes: (a boolean, nipype default value: False)
whether the rotation is searched around an initial principal axis
alignment.
argument: ``%d``, position: 6
local_search: (an integer (int or long), nipype default value: 10)
determines if a local optimization is run at each search point for
the set number of iterations
argument: ``%d``, position: 7
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
out_file: (a pathlike object or string representing a file)
output transform file
AverageAffineTransform¶
Wraps the executable command AverageAffineTransform
.
Examples¶
>>> from nipype.interfaces.ants import AverageAffineTransform
>>> avg = AverageAffineTransform()
>>> avg.inputs.dimension = 3
>>> avg.inputs.transforms = ['trans.mat', 'func_to_struct.mat']
>>> avg.inputs.output_affine_transform = 'MYtemplatewarp.mat'
>>> avg.cmdline
'AverageAffineTransform 3 MYtemplatewarp.mat trans.mat func_to_struct.mat'
Inputs:
[Mandatory]
dimension: (3 or 2)
image dimension (2 or 3)
argument: ``%d``, position: 0
output_affine_transform: (a pathlike object or string representing a
file)
Outputfname.txt: the name of the resulting transform.
argument: ``%s``, position: 1
transforms: (a list of items which are a pathlike object or string
representing an existing file)
transforms to average
argument: ``%s``, position: 3
[Optional]
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
affine_transform: (a pathlike object or string representing an
existing file)
average transform file
AverageImages¶
Wraps the executable command AverageImages
.
Examples¶
>>> from nipype.interfaces.ants import AverageImages
>>> avg = AverageImages()
>>> avg.inputs.dimension = 3
>>> avg.inputs.output_average_image = "average.nii.gz"
>>> avg.inputs.normalize = True
>>> avg.inputs.images = ['rc1s1.nii', 'rc1s1.nii']
>>> avg.cmdline
'AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii'
Inputs:
[Mandatory]
dimension: (3 or 2)
image dimension (2 or 3)
argument: ``%d``, position: 0
normalize: (a boolean)
Normalize: if true, the 2nd image is divided by its mean. This will
select the largest image to average into.
argument: ``%d``, position: 2
images: (a list of items which are a pathlike object or string
representing an existing file)
image to apply transformation to (generally a coregistered
functional)
argument: ``%s``, position: 3
[Optional]
output_average_image: (a pathlike object or string representing a
file, nipype default value: average.nii)
the name of the resulting image.
argument: ``%s``, position: 1
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
output_average_image: (a pathlike object or string representing an
existing file)
average image file
ComposeMultiTransform¶
Wraps the executable command ComposeMultiTransform
.
Take a set of transformations and convert them to a single transformation matrix/warpfield.
Examples¶
>>> from nipype.interfaces.ants import ComposeMultiTransform
>>> compose_transform = ComposeMultiTransform()
>>> compose_transform.inputs.dimension = 3
>>> compose_transform.inputs.transforms = ['struct_to_template.mat', 'func_to_struct.mat']
>>> compose_transform.cmdline
'ComposeMultiTransform 3 struct_to_template_composed.mat struct_to_template.mat func_to_struct.mat'
Inputs:
[Mandatory]
transforms: (a list of items which are a pathlike object or string
representing an existing file)
transforms to average
argument: ``%s``, position: 3
[Optional]
dimension: (3 or 2, nipype default value: 3)
image dimension (2 or 3)
argument: ``%d``, position: 0
output_transform: (a pathlike object or string representing a file)
the name of the resulting transform.
argument: ``%s``, position: 1
reference_image: (a pathlike object or string representing a file)
Reference image (only necessary when output is warpfield)
argument: ``%s``, position: 2
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
output_transform: (a pathlike object or string representing an
existing file)
Composed transform file
CreateJacobianDeterminantImage¶
Wraps the executable command CreateJacobianDeterminantImage
.
Examples¶
>>> from nipype.interfaces.ants import CreateJacobianDeterminantImage
>>> jacobian = CreateJacobianDeterminantImage()
>>> jacobian.inputs.imageDimension = 3
>>> jacobian.inputs.deformationField = 'ants_Warp.nii.gz'
>>> jacobian.inputs.outputImage = 'out_name.nii.gz'
>>> jacobian.cmdline
'CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz'
Inputs:
[Mandatory]
imageDimension: (3 or 2)
image dimension (2 or 3)
argument: ``%d``, position: 0
deformationField: (a pathlike object or string representing an
existing file)
deformation transformation file
argument: ``%s``, position: 1
outputImage: (a pathlike object or string representing a file)
output filename
argument: ``%s``, position: 2
[Optional]
doLogJacobian: (0 or 1)
return the log jacobian
argument: ``%d``, position: 3
useGeometric: (0 or 1)
return the geometric jacobian
argument: ``%d``, position: 4
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
jacobian_image: (a pathlike object or string representing an existing
file)
jacobian image
LabelGeometry¶
Wraps the executable command LabelGeometryMeasures
.
Extracts geometry measures using a label file and an optional image file
Examples¶
>>> from nipype.interfaces.ants import LabelGeometry
>>> label_extract = LabelGeometry()
>>> label_extract.inputs.dimension = 3
>>> label_extract.inputs.label_image = 'atlas.nii.gz'
>>> label_extract.cmdline
'LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv'
>>> label_extract.inputs.intensity_image = 'ants_Warp.nii.gz'
>>> label_extract.cmdline
'LabelGeometryMeasures 3 atlas.nii.gz ants_Warp.nii.gz atlas.csv'
Inputs:
[Mandatory]
label_image: (a pathlike object or string representing a file)
label image to use for extracting geometry measures
argument: ``%s``, position: 1
intensity_image: (a pathlike object or string representing an
existing file, nipype default value: [])
Intensity image to extract values from. This is an optional input
argument: ``%s``, position: 2
[Optional]
dimension: (3 or 2, nipype default value: 3)
image dimension (2 or 3)
argument: ``%d``, position: 0
output_file: (a unicode string)
name of output file
argument: ``%s``, position: 3
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
output_file: (a pathlike object or string representing an existing
file)
CSV file of geometry measures
MultiplyImages¶
Wraps the executable command MultiplyImages
.
Examples¶
>>> from nipype.interfaces.ants import MultiplyImages
>>> test = MultiplyImages()
>>> test.inputs.dimension = 3
>>> test.inputs.first_input = 'moving2.nii'
>>> test.inputs.second_input = 0.25
>>> test.inputs.output_product_image = "out.nii"
>>> test.cmdline
'MultiplyImages 3 moving2.nii 0.25 out.nii'
Inputs:
[Mandatory]
dimension: (3 or 2)
image dimension (2 or 3)
argument: ``%d``, position: 0
first_input: (a pathlike object or string representing an existing
file)
image 1
argument: ``%s``, position: 1
second_input: (a pathlike object or string representing an existing
file or a float)
image 2 or multiplication weight
argument: ``%s``, position: 2
output_product_image: (a pathlike object or string representing a
file)
Outputfname.nii.gz: the name of the resulting image.
argument: ``%s``, position: 3
[Optional]
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
Outputs:
output_product_image: (a pathlike object or string representing an
existing file)
average image file