.. AUTO-GENERATED FILE -- DO NOT EDIT!

interfaces.ants.normalize
=========================


.. _nipype.interfaces.ants.normalize.BuildTemplate:


.. index:: BuildTemplate

BuildTemplate
-------------

Code: http://github.com/nipy/nipype/blob/master/nipype/interfaces/ants/normalize.py#L85

Wraps command **buildtemplateparallel.sh**

Generate a optimal average template

.. warning::

  This can take a VERY long time to complete

Examples
~~~~~~~~

>>> from nipype.interfaces.ants import BuildTemplate
>>> tmpl = BuildTemplate()
>>> 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

        [Optional]
        args: (a string)
                Additional parameters to the command
        bias_field_correction: (a boolean)
                Applies bias field correction to moving image
        dimension: (3 or 2, nipype default value: 3)
                image dimension (2 or 3)
        environ: (a dictionary with keys which are a value of type 'str' and with values which
                 are a value of type 'str', nipype default value: {})
                Environment variables
        gradient_step_size: (a float)
                smaller magnitude results in more cautious steps (default = .25)
        ignore_exception: (a boolean, nipype default value: False)
                Print an error message instead of throwing an exception in case the interface fails to
                run
        iteration_limit: (an integer, nipype default value: 4)
                iterations of template construction
        max_iterations: (a list of items which are an integer)
                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
        num_cores: (an integer)
                Requires parallelization = 2 (PEXEC). Sets number of cpu cores to use
                requires: parallelization
        num_threads: (an integer, nipype default value: 1)
                Number of ITK threads to use
        out_prefix: (a string, nipype default value: antsTMPL_)
                Prefix that is prepended to all output files (default = antsTMPL_)
        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
        rigid_body_registration: (a boolean)
                registers inputs before creating template (useful if no initial template available)
        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)
        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
        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.

Outputs::

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