interfaces.ants.legacy

GenWarpFields

Link to code

Wraps the executable command antsIntroduction.sh.

Inputs:

[Mandatory]
reference_image: (an existing file name)
        template file to warp to
        argument: ``-r %s``
input_image: (an existing file name)
        input image to warp to template
        argument: ``-i %s``

[Optional]
dimension: (3 or 2, nipype default value: 3)
        image dimension (2 or 3)
        argument: ``-d %d``, position: 1
force_proceed: (a boolean)
        force script to proceed even if headers may be incompatible
        argument: ``-f 1``
inverse_warp_template_labels: (a boolean)
        Applies inverse warp to the template labels to estimate label
        positions in target space (use for template-based segmentation)
        argument: ``-l``
max_iterations: (a list of items which are an integer (int or long))
        maximum number of iterations (must be list of integers in the form
        [J,K,L...]: J = coarsest resolution iterations, K = middle
        resolution interations, L = fine resolution iterations
        argument: ``-m %s``
bias_field_correction: (a boolean)
        Applies bias field correction to moving image
        argument: ``-n 1``
similarity_metric: ('PR' or 'CC' or 'MI' or 'MSQ')
        Type of similartiy metric used for registration (CC = cross
        correlation, MI = mutual information, PR = probability mapping, MSQ
        = mean square difference)
        argument: ``-s %s``
transformation_model: ('GR' or 'EL' or 'SY' or 'S2' or 'EX' or 'DD'
          or 'RI' or 'RA', nipype default value: GR)
        Type of transofmration model used for registration (EL = elastic
        transformation model, SY = SyN with time, arbitrary number of time
        points, S2 = SyN with time optimized for 2 time points, GR = greedy
        SyN, EX = exponential, DD = diffeomorphic demons style exponential
        mapping, RI = purely rigid, RA = affine rigid
        argument: ``-t %s``
out_prefix: (a unicode string, nipype default value: ants_)
        Prefix that is prepended to all output files (default = ants_)
        argument: ``-o %s``
quality_check: (a boolean)
        Perform a quality check of the result
        argument: ``-q 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:

affine_transformation: (an existing file name)
        affine (prefix_Affine.txt)
warp_field: (an existing file name)
        warp field (prefix_Warp.nii)
inverse_warp_field: (an existing file name)
        inverse warp field (prefix_InverseWarp.nii)
input_file: (an existing file name)
        input image (prefix_repaired.nii)
output_file: (an existing file name)
        output image (prefix_deformed.nii)

antsIntroduction

Link to code

Wraps the executable command antsIntroduction.sh.

Uses ANTS to generate matrices to warp data from one space to another.

Examples

>>> from nipype.interfaces.ants.legacy import antsIntroduction
>>> warp = antsIntroduction()
>>> warp.inputs.reference_image = 'Template_6.nii'
>>> warp.inputs.input_image = 'structural.nii'
>>> warp.inputs.max_iterations = [30,90,20]
>>> warp.cmdline
'antsIntroduction.sh -d 3 -i structural.nii -m 30x90x20 -o ants_ -r Template_6.nii -t GR'

Inputs:

[Mandatory]
reference_image: (an existing file name)
        template file to warp to
        argument: ``-r %s``
input_image: (an existing file name)
        input image to warp to template
        argument: ``-i %s``

[Optional]
dimension: (3 or 2, nipype default value: 3)
        image dimension (2 or 3)
        argument: ``-d %d``, position: 1
force_proceed: (a boolean)
        force script to proceed even if headers may be incompatible
        argument: ``-f 1``
inverse_warp_template_labels: (a boolean)
        Applies inverse warp to the template labels to estimate label
        positions in target space (use for template-based segmentation)
        argument: ``-l``
max_iterations: (a list of items which are an integer (int or long))
        maximum number of iterations (must be list of integers in the form
        [J,K,L...]: J = coarsest resolution iterations, K = middle
        resolution interations, L = fine resolution iterations
        argument: ``-m %s``
bias_field_correction: (a boolean)
        Applies bias field correction to moving image
        argument: ``-n 1``
similarity_metric: ('PR' or 'CC' or 'MI' or 'MSQ')
        Type of similartiy metric used for registration (CC = cross
        correlation, MI = mutual information, PR = probability mapping, MSQ
        = mean square difference)
        argument: ``-s %s``
transformation_model: ('GR' or 'EL' or 'SY' or 'S2' or 'EX' or 'DD'
          or 'RI' or 'RA', nipype default value: GR)
        Type of transofmration model used for registration (EL = elastic
        transformation model, SY = SyN with time, arbitrary number of time
        points, S2 = SyN with time optimized for 2 time points, GR = greedy
        SyN, EX = exponential, DD = diffeomorphic demons style exponential
        mapping, RI = purely rigid, RA = affine rigid
        argument: ``-t %s``
out_prefix: (a unicode string, nipype default value: ants_)
        Prefix that is prepended to all output files (default = ants_)
        argument: ``-o %s``
quality_check: (a boolean)
        Perform a quality check of the result
        argument: ``-q 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:

affine_transformation: (an existing file name)
        affine (prefix_Affine.txt)
warp_field: (an existing file name)
        warp field (prefix_Warp.nii)
inverse_warp_field: (an existing file name)
        inverse warp field (prefix_InverseWarp.nii)
input_file: (an existing file name)
        input image (prefix_repaired.nii)
output_file: (an existing file name)
        output image (prefix_deformed.nii)

buildtemplateparallel

Link to code

Wraps the executable command buildtemplateparallel.sh.

Generate a optimal average template

Warning

This can take a VERY long time to complete

Examples

>>> from nipype.interfaces.ants.legacy import buildtemplateparallel
>>> tmpl = buildtemplateparallel()
>>> tmpl.inputs.in_files = ['T1.nii', 'structural.nii']
>>> tmpl.inputs.max_iterations = [30, 90, 20]
>>> tmpl.cmdline
'buildtemplateparallel.sh -d 3 -i 4 -m 30x90x20 -o antsTMPL_ -c 0 -t GR T1.nii structural.nii'

Inputs:

[Mandatory]
in_files: (a list of items which are an existing file name)
        list of images to generate template from
        argument: ``%s``, position: -1

[Optional]
dimension: (3 or 2 or 4, nipype default value: 3)
        image dimension (2, 3 or 4)
        argument: ``-d %d``, position: 1
out_prefix: (a unicode string, nipype default value: antsTMPL_)
        Prefix that is prepended to all output files (default = antsTMPL_)
        argument: ``-o %s``
parallelization: (0 or 1 or 2, nipype default value: 0)
        control for parallel processing (0 = serial, 1 = use PBS, 2 = use
        PEXEC, 3 = use Apple XGrid
        argument: ``-c %d``
gradient_step_size: (a float)
        smaller magnitude results in more cautious steps (default = .25)
        argument: ``-g %f``
iteration_limit: (an integer (int or long), nipype default value: 4)
        iterations of template construction
        argument: ``-i %d``
num_cores: (an integer (int or long))
        Requires parallelization = 2 (PEXEC). Sets number of cpu cores to
        use
        argument: ``-j %d``
        requires: parallelization
max_iterations: (a list of items which are an integer (int or long))
        maximum number of iterations (must be list of integers in the form
        [J,K,L...]: J = coarsest resolution iterations, K = middle
        resolution interations, L = fine resolution iterations
        argument: ``-m %s``
bias_field_correction: (a boolean)
        Applies bias field correction to moving image
        argument: ``-n 1``
rigid_body_registration: (a boolean)
        registers inputs before creating template (useful if no initial
        template available)
        argument: ``-r 1``
similarity_metric: ('PR' or 'CC' or 'MI' or 'MSQ')
        Type of similartiy metric used for registration (CC = cross
        correlation, MI = mutual information, PR = probability mapping, MSQ
        = mean square difference)
        argument: ``-s %s``
transformation_model: ('GR' or 'EL' or 'SY' or 'S2' or 'EX' or 'DD',
          nipype default value: GR)
        Type of transofmration model used for registration (EL = elastic
        transformation model, SY = SyN with time, arbitrary number of time
        points, S2 = SyN with time optimized for 2 time points, GR = greedy
        SyN, EX = exponential, DD = diffeomorphic demons style exponential
        mapping
        argument: ``-t %s``
use_first_as_target: (a boolean)
        uses first volume as target of all inputs. When not used, an
        unbiased average image is used to start.
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:

final_template_file: (an existing file name)
        final ANTS template
template_files: (a list of items which are an existing file name)
        Templates from different stages of iteration
subject_outfiles: (a list of items which are an existing file name)
        Outputs for each input image. Includes warp field, inverse warp,
        Affine, original image (repaired) and warped image (deformed)