Registration#

CPAC.registration.create_bbregister_func_to_anat(phase_diff_distcor=False, name='bbregister_func_to_anat')[source]#

Registers a functional scan in native space to structural. This is meant to be used after create_nonlinear_register() has been run and relies on some of its outputs.

Parameters:
  • fieldmap_distortion (bool, optional) – If field map-based distortion correction is being run, FLIRT should take in the appropriate field map-related inputs.

  • name (string, optional) – Name of the workflow.

Returns:

register_func_to_anat

Return type:

nipype.pipeline.engine.Workflow

Notes

Workflow Inputs:

inputspec.func : string (nifti file)
    Input functional scan to be registered to MNI space
inputspec.anat : string (nifti file)
    Corresponding full-head or brain scan of subject
inputspec.linear_reg_matrix : string (mat file)
    Affine matrix from linear functional to anatomical registration
inputspec.anat_wm_segmentation : string (nifti file)
    White matter segmentation probability mask in anatomical space
inputspec.bbr_schedule : string (.sch file)
    Boundary based registration schedule file for flirt command

Workflow Outputs:

outputspec.func_to_anat_linear_xfm : string (mat file)
    Affine transformation from functional to anatomical native space
outputspec.anat_func : string (nifti file)
    Functional data in anatomical space
CPAC.registration.create_fsl_fnirt_nonlinear_reg(name='fsl_fnirt_nonlinear_reg')[source]#

Performs non-linear registration of an input file to a reference file using FSL FNIRT.

Parameters:

name (string, optional) – Name of the workflow.

Returns:

nonlinear_register

Return type:

nipype.pipeline.engine.Workflow

Notes

Workflow Inputs:

inputspec.input_skull : string (nifti file)
    File of input brain with skull
inputspec.reference_skull : string (nifti file)
    Target brain with skull to normalize to
inputspec.fnirt_config : string (fsl fnirt config file)
    Configuration file containing parameters that can be
    specified in fnirt

Workflow Outputs:

outputspec.output_brain : string (nifti file)
    Normalizion of input brain file
outputspec.nonlinear_xfm : string
    Nonlinear field coefficients file of nonlinear transformation

Registration Procedure:

  1. Perform a nonlinear registration on an input file to the reference file utilizing affine transformation from the previous step as a starting point.

  2. Invert the affine transformation to provide the user a transformation (affine only) from the space of the reference file to the input file.

Workflow Graph:

developer/images/nonlinear_register.dot.png

Detailed Workflow Graph: .. image:: ../images/nonlinear_register_detailed.dot.png

width:

500

CPAC.registration.create_fsl_fnirt_nonlinear_reg_nhp(name='fsl_fnirt_nonlinear_reg_nhp')[source]#

Performs non-linear registration of an input file to a reference file using FSL FNIRT.

Parameters:

name (string, optional) – Name of the workflow.

Returns:

nonlinear_register

Return type:

nipype.pipeline.engine.Workflow

Notes

Workflow Inputs:

inputspec.input_skull : string (nifti file)
    File of input brain with skull
inputspec.reference_skull : string (nifti file)
    Target brain with skull to normalize to
inputspec.fnirt_config : string (fsl fnirt config file)
    Configuration file containing parameters that can be
    specified in fnirt

Workflow Outputs:

outputspec.output_brain : string (nifti file)
    Normalizion of input brain file
outputspec.nonlinear_xfm : string
    Nonlinear field coefficients file of nonlinear transformation
outputspec.nonlinear_warp : string
    Nonlinear output file with warp field

Registration Procedure:

  1. Perform a nonlinear registration on an input file to the reference file utilizing affine transformation from the previous step as a starting point.

  2. Invert the affine transformation to provide the user a transformation (affine only) from the space of the reference file to the input file.

Workflow Graph:

developer/images/nonlinear_register.dot.png

Detailed Workflow Graph: .. image:: ../images/nonlinear_register_detailed.dot.png

width:

500

CPAC.registration.create_register_func_to_anat(config, phase_diff_distcor=False, name='register_func_to_anat')[source]#

Registers a functional scan in native space to anatomical space using a linear transform and does not include bbregister.

Parameters:
  • config (configuration, mandatory) – Pipeline configuration.

  • fieldmap_distortion (bool, optional) – If field map-based distortion correction is being run, FLIRT should take in the appropriate field map-related inputs.

  • name (string, optional) – Name of the workflow.

Returns:

create_register_func_to_anat

Return type:

nipype.pipeline.engine.Workflow

Notes

Workflow Inputs:

inputspec.func : string (nifti file)
    Input functional scan to be registered to anatomical space
inputspec.anat : string (nifti file)
    Corresponding anatomical scan of subject
inputspec.interp : string
    Type of interpolation to use
    ('trilinear' or 'nearestneighbour' or 'sinc')

Workflow Outputs:

outputspec.func_to_anat_linear_xfm_nobbreg : string (mat file)
    Affine transformation from functional to anatomical native space
outputspec.anat_func_nobbreg : string (nifti file)
    Functional scan registered to anatomical space
CPAC.registration.create_register_func_to_anat_use_T2(config, name='register_func_to_anat_use_T2')[source]#

Registers a functional scan in native space to anatomical space using a linear transform and does not include bbregister, use T1 and T2 image.

Parameters:
  • config (configuration, mandatory) – Pipeline configuration.

  • name (string, optional) – Name of the workflow.

Returns:

create_register_func_to_anat_use_T2

Return type:

nipype.pipeline.engine.Workflow

Notes

Workflow Inputs:

inputspec.func : string (nifti file)
    Input functional scan to be registered to anatomical space
inputspec.anat : string (nifti file)
    Corresponding anatomical scan of subject

Workflow Outputs:

outputspec.func_to_anat_linear_xfm_nobbreg : string (mat file)
    Affine transformation from functional to anatomical native space
outputspec.anat_func_nobbreg : string (nifti file)
    Functional scan registered to anatomical space
CPAC.registration.create_wf_calculate_ants_warp(name='create_wf_calculate_ants_warp', num_threads=1, reg_ants_skull=1)[source]#

Calculates the nonlinear ANTS registration transform. This workflow employs the antsRegistration tool:

http://stnava.github.io/ANTs/

Parameters:

name (string, optional) – Name of the workflow.

Returns:

calc_ants_warp_wf

Return type:

nipype.pipeline.engine.Workflow

Notes

Some of the inputs listed below are lists or lists of lists. This is because antsRegistration can perform multiple stages of calculations depending on how the user configures their registration.

For example, if one wants to employ a different metric (with different parameters) at each stage, the lists would be configured like this:

warp_wf.inputs.inputspec.transforms = [‘Rigid’,’Affine’,’SyN’] warp_wf.inputs.inputspec.transform_parameters = [[0.1],[0.1],[0.1,3,0]]

..where each element in the first list is a metric to be used at each stage, ‘Rigid’ being for stage 1, ‘Affine’ for stage 2, etc. The lists within the list for transform_parameters would then correspond to each stage’s metric, with [0.1] applying to ‘Rigid’ and ‘Affine’ (stages 1 and 2), and [0.1,3,0] applying to ‘SyN’ of stage 3.

In some cases, when a parameter is not needed for a stage, ‘None’ must be entered in its place if there are other parameters for other stages.

Workflow Inputs:

inputspec.moving_brain : string (nifti file)
    File of brain to be normalized (registered)
inputspec.reference_brain : string (nifti file)
    Target brain file to normalize to
inputspec.dimension : integer
    Dimension of the image (default: 3)
inputspec.use_histogram_matching : boolean
    Histogram match the images before registration
inputspec.winsorize_lower_quantile : float
    Winsorize data based on quantiles (lower range)
inputspec.winsorize_higher_quantile : float
    Winsorize data based on quantiles (higher range)
inputspec.metric : list of strings
    Image metric(s) to be used at each stage
inputspec.metric_weight : list of floats
    Modulate the per-stage weighting of the corresponding metric
inputspec.radius_or_number_of_bins : list of integers
    Number of bins in each stage for the MI and Mattes metric, the
    radius for other metrics
inputspec.sampling_strategy : list of strings
    Sampling strategy (or strategies) to use for the metrics
    {None, Regular, or Random}
inputspec.sampling_percentage : list of floats
    Defines the sampling strategy
    {float value, or None}
inputspec.number_of_iterations : list of lists of integers
    Determines the convergence
inputspec.convergence_threshold : list of floats
    Threshold compared to the slope of the line fitted in convergence
inputspec.convergence_window_size : list of integers
    Window size of convergence calculations
inputspec.transforms : list of strings
    Selection of transform options. See antsRegistration documentation
    for a full list of options and their descriptions
inputspec.transform_parameters : list of lists of floats
    Fine-tuning for the different transform options
inputspec.shrink_factors : list of lists of integers
    Specify the shrink factor for the virtual domain (typically the
    fixed image) at each level
inputspec.smoothing_sigmas : list of lists of floats
    Specify the sigma of gaussian smoothing at each level
inputspec.fixed_image_mask: (an existing file name)
    Mask used to limit metric sampling region of the fixed imagein all
    stages
inputspec.interp : string
    Type of interpolation to use
    ('Linear' or 'BSpline' or 'LanczosWindowedSinc')

Workflow Outputs:

outputspec.warp_field : string (nifti file)
    Output warp field of registration
outputspec.inverse_warp_field : string (nifti file)
    Inverse of the warp field of the registration
outputspec.ants_affine_xfm : string (.mat file)
    The affine matrix of the registration
outputspec.ants_inverse_affine_xfm : string (.mat file)
    The affine matrix of the reverse registration
outputspec.composite_transform : string (nifti file)
    The combined transform including the warp field and rigid & affine
    linear warps
outputspec.normalized_output_brain : string (nifti file)
    Template-registered version of input brain

Registration Procedure:

  1. Calculates a nonlinear anatomical-to-template registration.


Workflow Graph: .. image:

:width: 500

Detailed Workflow Graph: