interfaces.elastix.registration

AnalyzeWarp

Link to code

Wraps the executable command transformix.

Use transformix to get details from the input transform (generate the corresponding deformation field, generate the determinant of the Jacobian map or the Jacobian map itself)

Example

>>> from nipype.interfaces.elastix import AnalyzeWarp
>>> reg = AnalyzeWarp()
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
>>> reg.cmdline
'transformix -def all -jac all -jacmat all -threads 1 -out ./ -tp TransformParameters.0.txt'

Inputs:

[Mandatory]
transform_file: (a pathlike object or string representing an existing
          file)
        transform-parameter file, only 1
        argument: ``-tp %s``
output_path: (a pathlike object or string representing an existing
          directory, nipype default value: ./)
        output directory
        argument: ``-out %s``

[Optional]
points: ('all', nipype default value: all)
        transform all points from the input-image, which effectively
        generates a deformation field.
        argument: ``-def %s``, position: 0
jac: ('all', nipype default value: all)
        generate an image with the determinant of the spatial Jacobian
        argument: ``-jac %s``
jacmat: ('all', nipype default value: all)
        generate an image with the spatial Jacobian matrix at each voxel
        argument: ``-jacmat %s``
moving_image: (a pathlike object or string representing an existing
          file)
        input image to deform (not used)
        argument: ``-in %s``
num_threads: (an integer (int or long), nipype default value: 1)
        set the maximum number of threads of elastix
        argument: ``-threads %01d``
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:

disp_field: (a pathlike object or string representing a file)
        displacements field
jacdet_map: (a pathlike object or string representing a file)
        det(Jacobian) map
jacmat_map: (a pathlike object or string representing a file)
        Jacobian matrix map

ApplyWarp

Link to code

Wraps the executable command transformix.

Use transformix to apply a transform on an input image. The transform is specified in the transform-parameter file.

Example

>>> from nipype.interfaces.elastix import ApplyWarp
>>> reg = ApplyWarp()
>>> reg.inputs.moving_image = 'moving1.nii'
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
>>> reg.cmdline
'transformix -in moving1.nii -threads 1 -out ./ -tp TransformParameters.0.txt'

Inputs:

[Mandatory]
transform_file: (a pathlike object or string representing an existing
          file)
        transform-parameter file, only 1
        argument: ``-tp %s``
moving_image: (a pathlike object or string representing an existing
          file)
        input image to deform
        argument: ``-in %s``
output_path: (a pathlike object or string representing an existing
          directory, nipype default value: ./)
        output directory
        argument: ``-out %s``

[Optional]
num_threads: (an integer (int or long), nipype default value: 1)
        set the maximum number of threads of elastix
        argument: ``-threads %01d``
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:

warped_file: (a pathlike object or string representing a file)
        input moving image warped to fixed image

PointsWarp

Link to code

Wraps the executable command transformix.

Use transformix to apply a transform on an input point set. The transform is specified in the transform-parameter file.

Example

>>> from nipype.interfaces.elastix import PointsWarp
>>> reg = PointsWarp()
>>> reg.inputs.points_file = 'surf1.vtk'
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
>>> reg.cmdline
'transformix -threads 1 -out ./ -def surf1.vtk -tp TransformParameters.0.txt'

Inputs:

[Mandatory]
points_file: (a pathlike object or string representing an existing
          file)
        input points (accepts .vtk triangular meshes).
        argument: ``-def %s``
transform_file: (a pathlike object or string representing an existing
          file)
        transform-parameter file, only 1
        argument: ``-tp %s``
output_path: (a pathlike object or string representing an existing
          directory, nipype default value: ./)
        output directory
        argument: ``-out %s``

[Optional]
num_threads: (an integer (int or long), nipype default value: 1)
        set the maximum number of threads of elastix
        argument: ``-threads %01d``
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:

warped_file: (a pathlike object or string representing a file)
        input points displaced in fixed image domain

Registration

Link to code

Wraps the executable command elastix.

Elastix nonlinear registration interface

Example

>>> from nipype.interfaces.elastix import Registration
>>> reg = Registration()
>>> reg.inputs.fixed_image = 'fixed1.nii'
>>> reg.inputs.moving_image = 'moving1.nii'
>>> reg.inputs.parameters = ['elastix.txt']
>>> reg.cmdline
'elastix -f fixed1.nii -m moving1.nii -threads 1 -out ./ -p elastix.txt'

Inputs:

[Mandatory]
fixed_image: (a pathlike object or string representing an existing
          file)
        fixed image
        argument: ``-f %s``
moving_image: (a pathlike object or string representing an existing
          file)
        moving image
        argument: ``-m %s``
parameters: (a list of items which are a pathlike object or string
          representing an existing file)
        parameter file, elastix handles 1 or more -p
        argument: ``-p %s...``
output_path: (a pathlike object or string representing an existing
          directory, nipype default value: ./)
        output directory
        argument: ``-out %s``

[Optional]
fixed_mask: (a pathlike object or string representing an existing
          file)
        mask for fixed image
        argument: ``-fMask %s``
moving_mask: (a pathlike object or string representing an existing
          file)
        mask for moving image
        argument: ``-mMask %s``
initial_transform: (a pathlike object or string representing an
          existing file)
        parameter file for initial transform
        argument: ``-t0 %s``
num_threads: (an integer (int or long), nipype default value: 1)
        set the maximum number of threads of elastix
        argument: ``-threads %01d``
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:

transform: (a list of items which are a pathlike object or string
          representing an existing file)
        output transform
warped_file: (a pathlike object or string representing a file)
        input moving image warped to fixed image
warped_files: (a list of items which are a pathlike object or string
          representing a file)
        input moving image warped to fixed image at each level
warped_files_flags: (a list of items which are a boolean)
        flag indicating if warped image was generated