xcp_d.interfaces.ants.ApplyTransforms

class xcp_d.interfaces.ants.ApplyTransforms(**inputs)[source]

Wrapped executable: antsApplyTransforms.

A modified version of FixHeaderApplyTransforms from niworkflows.

The niworkflows version of ApplyTransforms “fixes the resampled image header to match the xform of the reference image”. This modification overrides the allowed interpolation values, since FixHeaderApplyTransforms doesn’t support GenericLabel, which is preferred over MultiLabel.

Mandatory Inputs:
  • input_image (a pathlike object or string representing an existing file) – Image to apply transformation to (generally a coregistered functional). Maps to a command-line argument: --input %s.

  • reference_image (a pathlike object or string representing an existing file) – Reference image space that you wish to warp INTO. Maps to a command-line argument: --reference-image %s.

  • transforms (a list of items which are a pathlike object or string representing an existing file or ‘identity’) – Transform files: will be applied in reverse order. For example, the last specified transform will be applied first. Maps to a command-line argument: %s.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • default_value (a float) – Maps to a command-line argument: --default-value %g. (Nipype default value: 0.0)

  • dimension (2 or 3 or 4) – This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. Maps to a command-line argument: --dimensionality %d.

  • 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’) – Environment variables. (Nipype default value: {})

  • float (a boolean) – Use float instead of double for computations. Maps to a command-line argument: --float %d. (Nipype default value: False)

  • input_image_type (0 or 1 or 2 or 3) – Option specifying the input image type of scalar (default), vector, tensor, or time series. Maps to a command-line argument: --input-image-type %d.

  • interpolation (‘Linear’ or ‘NearestNeighbor’ or ‘CosineWindowedSinc’ or ‘WelchWindowedSinc’ or ‘HammingWindowedSinc’ or ‘LanczosWindowedSinc’ or ‘MultiLabel’ or ‘Gaussian’ or ‘BSpline’ or ‘GenericLabel’) – Maps to a command-line argument: %s. (Nipype default value: Linear)

  • interpolation_parameters (a tuple of the form: (an integer) or a tuple of the form: (a float, a float))

  • invert_transform_flags (a list of items which are a boolean)

  • num_threads (an integer) – Number of ITK threads to use. (Nipype default value: 1)

  • out_postfix (a string) – Postfix that is appended to all output files (default = _trans). (Nipype default value: _trans)

  • output_image (a string) – Output file name. Maps to a command-line argument: --output %s.

  • print_out_composite_warp_file (a boolean) – Output a composite warp file instead of a transformed image. Requires inputs: output_image.

Outputs:

output_image (a pathlike object or string representing an existing file) – Warped image.

__init__(**inputs)[source]

Subclasses must implement __init__

Methods

__init__(**inputs)

Subclasses must implement __init__

aggregate_outputs([runtime, needed_outputs])

Collate expected outputs and apply output traits validation.

help([returnhelp])

Prints class help

load_inputs_from_json(json_file[, overwrite])

A convenient way to load pre-set inputs from a JSON file.

raise_exception(runtime)

run([cwd, ignore_exception])

Execute this interface.

save_inputs_to_json(json_file)

A convenient way to save current inputs to a JSON file.

set_default_num_threads(num_threads)

Set the default number of threads for ITK calls

set_default_terminal_output(output_type)

Set the default terminal output for CommandLine Interfaces.

version_from_command([flag, cmd])

Attributes

always_run

Should the interface be always run even if the inputs were not changed? Only applies to interfaces being run within a workflow context.

can_resume

Defines if the interface can reuse partial results after interruption.

cmd

sets base command, immutable

cmdline

command plus any arguments (args) validates arguments and generates command line

resource_monitor

terminal_output

version

interfaces should implement a version property

write_cmdline