# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *

GREEDY_METADATA = Metadata(
    id="cb84db88438f1674b1e435e7a18e6b4755de1b18.boutiques",
    name="greedy",
    package="greedy",
    container_image_tag="pyushkevich/itksnap:v3.8.2",
)


_GreedyInputImagesParamsDictNoTag = typing.TypedDict('_GreedyInputImagesParamsDictNoTag', {
    "fixed": InputPathType,
    "moving": InputPathType,
})
GreedyInputImagesParamsDictTagged = typing.TypedDict('GreedyInputImagesParamsDictTagged', {
    "@type": typing.Literal["input_images"],
    "fixed": InputPathType,
    "moving": InputPathType,
})
GreedyInputImagesParamsDict = _GreedyInputImagesParamsDictNoTag | GreedyInputImagesParamsDictTagged


_GreedyInvertParamsDictNoTag = typing.TypedDict('_GreedyInvertParamsDictNoTag', {
    "inwarp": InputPathType,
    "outwarp": str,
})
GreedyInvertParamsDictTagged = typing.TypedDict('GreedyInvertParamsDictTagged', {
    "@type": typing.Literal["invert"],
    "inwarp": InputPathType,
    "outwarp": str,
})
GreedyInvertParamsDict = _GreedyInvertParamsDictNoTag | GreedyInvertParamsDictTagged


_GreedyRootParamsDictNoTag = typing.TypedDict('_GreedyRootParamsDictNoTag', {
    "inwarp": InputPathType,
    "outwarp": str,
    "n": int,
})
GreedyRootParamsDictTagged = typing.TypedDict('GreedyRootParamsDictTagged', {
    "@type": typing.Literal["root"],
    "inwarp": InputPathType,
    "outwarp": str,
    "n": int,
})
GreedyRootParamsDict = _GreedyRootParamsDictNoTag | GreedyRootParamsDictTagged


_GreedyJacobianParamsDictNoTag = typing.TypedDict('_GreedyJacobianParamsDictNoTag', {
    "inwarp": InputPathType,
    "outjac": str,
})
GreedyJacobianParamsDictTagged = typing.TypedDict('GreedyJacobianParamsDictTagged', {
    "@type": typing.Literal["jacobian"],
    "inwarp": InputPathType,
    "outjac": str,
})
GreedyJacobianParamsDict = _GreedyJacobianParamsDictNoTag | GreedyJacobianParamsDictTagged


_GreedyMetricParamsDictNoTag = typing.TypedDict('_GreedyMetricParamsDictNoTag', {
    "metric_type": typing.Literal["SSD", "MI", "NMI", "NCC", "MAHAL"],
    "metric_param": typing.NotRequired[float | None],
})
GreedyMetricParamsDictTagged = typing.TypedDict('GreedyMetricParamsDictTagged', {
    "@type": typing.Literal["metric"],
    "metric_type": typing.Literal["SSD", "MI", "NMI", "NCC", "MAHAL"],
    "metric_param": typing.NotRequired[float | None],
})
GreedyMetricParamsDict = _GreedyMetricParamsDictNoTag | GreedyMetricParamsDictTagged


_GreedyTjrParamsDictNoTag = typing.TypedDict('_GreedyTjrParamsDictNoTag', {
    "mesh": InputPathType,
    "weight": float,
})
GreedyTjrParamsDictTagged = typing.TypedDict('GreedyTjrParamsDictTagged', {
    "@type": typing.Literal["tjr"],
    "mesh": InputPathType,
    "weight": float,
})
GreedyTjrParamsDict = _GreedyTjrParamsDictNoTag | GreedyTjrParamsDictTagged


_GreedySearchParamsDictNoTag = typing.TypedDict('_GreedySearchParamsDictNoTag', {
    "n": int,
    "rot": str,
    "tran": float,
})
GreedySearchParamsDictTagged = typing.TypedDict('GreedySearchParamsDictTagged', {
    "@type": typing.Literal["search"],
    "n": int,
    "rot": str,
    "tran": float,
})
GreedySearchParamsDict = _GreedySearchParamsDictNoTag | GreedySearchParamsDictTagged


_GreedyResliceMovingImageParamsDictNoTag = typing.TypedDict('_GreedyResliceMovingImageParamsDictNoTag', {
    "moving": InputPathType,
    "output": str,
})
GreedyResliceMovingImageParamsDictTagged = typing.TypedDict('GreedyResliceMovingImageParamsDictTagged', {
    "@type": typing.Literal["reslice_moving_image"],
    "moving": InputPathType,
    "output": str,
})
GreedyResliceMovingImageParamsDict = _GreedyResliceMovingImageParamsDictNoTag | GreedyResliceMovingImageParamsDictTagged


_GreedyResliceSurfaceParamsDictNoTag = typing.TypedDict('_GreedyResliceSurfaceParamsDictNoTag', {
    "inmesh": InputPathType,
    "outmesh": str,
})
GreedyResliceSurfaceParamsDictTagged = typing.TypedDict('GreedyResliceSurfaceParamsDictTagged', {
    "@type": typing.Literal["reslice_surface"],
    "inmesh": InputPathType,
    "outmesh": str,
})
GreedyResliceSurfaceParamsDict = _GreedyResliceSurfaceParamsDictNoTag | GreedyResliceSurfaceParamsDictTagged


_GreedyNnParamsDictNoTag = typing.TypedDict('_GreedyNnParamsDictNoTag', {})
GreedyNnParamsDictTagged = typing.TypedDict('GreedyNnParamsDictTagged', {
    "@type": typing.Literal["nn"],
})
GreedyNnParamsDict = _GreedyNnParamsDictNoTag | GreedyNnParamsDictTagged


_GreedyLinearParamsDictNoTag = typing.TypedDict('_GreedyLinearParamsDictNoTag', {})
GreedyLinearParamsDictTagged = typing.TypedDict('GreedyLinearParamsDictTagged', {
    "@type": typing.Literal["linear"],
})
GreedyLinearParamsDict = _GreedyLinearParamsDictNoTag | GreedyLinearParamsDictTagged


_GreedyLabelParamsDictNoTag = typing.TypedDict('_GreedyLabelParamsDictNoTag', {
    "sigma_spec": str,
})
GreedyLabelParamsDictTagged = typing.TypedDict('GreedyLabelParamsDictTagged', {
    "@type": typing.Literal["label"],
    "sigma_spec": str,
})
GreedyLabelParamsDict = _GreedyLabelParamsDictNoTag | GreedyLabelParamsDictTagged


_GreedyResliceSimplexJacobianParamsDictNoTag = typing.TypedDict('_GreedyResliceSimplexJacobianParamsDictNoTag', {
    "inmesh": InputPathType,
    "outmesh": str,
})
GreedyResliceSimplexJacobianParamsDictTagged = typing.TypedDict('GreedyResliceSimplexJacobianParamsDictTagged', {
    "@type": typing.Literal["reslice_simplex_jacobian"],
    "inmesh": InputPathType,
    "outmesh": str,
})
GreedyResliceSimplexJacobianParamsDict = _GreedyResliceSimplexJacobianParamsDictNoTag | GreedyResliceSimplexJacobianParamsDictTagged


_GreedyParamsDictNoTag = typing.TypedDict('_GreedyParamsDictNoTag', {
    "dimensions": int,
    "input_images": typing.NotRequired[GreedyInputImagesParamsDict | None],
    "output": typing.NotRequired[str | None],
    "affine": bool,
    "brute": typing.NotRequired[str | None],
    "moments": typing.NotRequired[typing.Literal[1, 2] | None],
    "reslice": typing.NotRequired[list[InputPathType] | None],
    "invert": typing.NotRequired[GreedyInvertParamsDict | None],
    "root": typing.NotRequired[GreedyRootParamsDict | None],
    "jacobian": typing.NotRequired[GreedyJacobianParamsDict | None],
    "metric_mode": bool,
    "defopt": bool,
    "weight": typing.NotRequired[float | None],
    "metric": typing.NotRequired[GreedyMetricParamsDict | None],
    "step_size": typing.NotRequired[str | None],
    "iterations": typing.NotRequired[str | None],
    "threads": typing.NotRequired[int | None],
    "fixed_mask": typing.NotRequired[InputPathType | None],
    "gm_trim": typing.NotRequired[float | None],
    "moving_mask": typing.NotRequired[InputPathType | None],
    "wncc_mask_dilate": bool,
    "reference_image": typing.NotRequired[InputPathType | None],
    "ref_pad": typing.NotRequired[float | None],
    "background": typing.NotRequired[str | None],
    "input_transform": typing.NotRequired[InputPathType | None],
    "zero_last_dimension": bool,
    "time_step_mode": typing.NotRequired[typing.Literal["CONST", "SCALE", "SCALEDOWN"] | None],
    "smoothing": typing.NotRequired[str | None],
    "inverse_warp": typing.NotRequired[InputPathType | None],
    "root_warp": typing.NotRequired[InputPathType | None],
    "warp_precision": typing.NotRequired[float | None],
    "noise": typing.NotRequired[float | None],
    "exponent": typing.NotRequired[float | None],
    "svf_mode": bool,
    "svlb": bool,
    "sv_incompr": bool,
    "initial_warp": typing.NotRequired[InputPathType | None],
    "tjr": typing.NotRequired[GreedyTjrParamsDict | None],
    "wr": typing.NotRequired[float | None],
    "initial_affine": typing.NotRequired[InputPathType | None],
    "ia_identity": bool,
    "ia_voxel_grid": bool,
    "ia_image_centers": bool,
    "ia_image_side": typing.NotRequired[str | None],
    "ia_moments": typing.NotRequired[typing.Literal[1, 2] | None],
    "affine_dof": typing.NotRequired[typing.Literal[6, 7, 12] | None],
    "jitter": typing.NotRequired[float | None],
    "search": typing.NotRequired[GreedySearchParamsDict | None],
    "det": typing.NotRequired[typing.Literal[-1, 1] | None],
    "cov_id": bool,
    "fixed_reslicing_image": typing.NotRequired[InputPathType | None],
    "reslice_moving_image": typing.NotRequired[GreedyResliceMovingImageParamsDict | None],
    "reslice_surface": typing.NotRequired[GreedyResliceSurfaceParamsDict | None],
    "interpolation": typing.NotRequired[typing.Union[GreedyNnParamsDictTagged, GreedyLinearParamsDictTagged, GreedyLabelParamsDictTagged] | None],
    "reslice_background": typing.NotRequired[float | None],
    "reslice_datatype": typing.NotRequired[typing.Literal["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"] | None],
    "reslice_composite": typing.NotRequired[InputPathType | None],
    "reslice_jacobian": typing.NotRequired[InputPathType | None],
    "reslice_simplex_jacobian": typing.NotRequired[GreedyResliceSimplexJacobianParamsDict | None],
    "reslice_mask": typing.NotRequired[InputPathType | None],
    "metric_gradient": typing.NotRequired[InputPathType | None],
    "debug_deriv": bool,
    "debug_deriv_eps": typing.NotRequired[float | None],
    "debug_aff_obj": bool,
    "dump_pyramid": bool,
    "dump_moving": bool,
    "dump_frequency": typing.NotRequired[float | None],
    "dump_prefix": typing.NotRequired[str | None],
    "powell": bool,
    "float": bool,
    "version": bool,
    "verbosity": typing.NotRequired[typing.Literal[0, 1, 2] | None],
})
GreedyParamsDictTagged = typing.TypedDict('GreedyParamsDictTagged', {
    "@type": typing.Literal["greedy/greedy"],
    "dimensions": int,
    "input_images": typing.NotRequired[GreedyInputImagesParamsDict | None],
    "output": typing.NotRequired[str | None],
    "affine": bool,
    "brute": typing.NotRequired[str | None],
    "moments": typing.NotRequired[typing.Literal[1, 2] | None],
    "reslice": typing.NotRequired[list[InputPathType] | None],
    "invert": typing.NotRequired[GreedyInvertParamsDict | None],
    "root": typing.NotRequired[GreedyRootParamsDict | None],
    "jacobian": typing.NotRequired[GreedyJacobianParamsDict | None],
    "metric_mode": bool,
    "defopt": bool,
    "weight": typing.NotRequired[float | None],
    "metric": typing.NotRequired[GreedyMetricParamsDict | None],
    "step_size": typing.NotRequired[str | None],
    "iterations": typing.NotRequired[str | None],
    "threads": typing.NotRequired[int | None],
    "fixed_mask": typing.NotRequired[InputPathType | None],
    "gm_trim": typing.NotRequired[float | None],
    "moving_mask": typing.NotRequired[InputPathType | None],
    "wncc_mask_dilate": bool,
    "reference_image": typing.NotRequired[InputPathType | None],
    "ref_pad": typing.NotRequired[float | None],
    "background": typing.NotRequired[str | None],
    "input_transform": typing.NotRequired[InputPathType | None],
    "zero_last_dimension": bool,
    "time_step_mode": typing.NotRequired[typing.Literal["CONST", "SCALE", "SCALEDOWN"] | None],
    "smoothing": typing.NotRequired[str | None],
    "inverse_warp": typing.NotRequired[InputPathType | None],
    "root_warp": typing.NotRequired[InputPathType | None],
    "warp_precision": typing.NotRequired[float | None],
    "noise": typing.NotRequired[float | None],
    "exponent": typing.NotRequired[float | None],
    "svf_mode": bool,
    "svlb": bool,
    "sv_incompr": bool,
    "initial_warp": typing.NotRequired[InputPathType | None],
    "tjr": typing.NotRequired[GreedyTjrParamsDict | None],
    "wr": typing.NotRequired[float | None],
    "initial_affine": typing.NotRequired[InputPathType | None],
    "ia_identity": bool,
    "ia_voxel_grid": bool,
    "ia_image_centers": bool,
    "ia_image_side": typing.NotRequired[str | None],
    "ia_moments": typing.NotRequired[typing.Literal[1, 2] | None],
    "affine_dof": typing.NotRequired[typing.Literal[6, 7, 12] | None],
    "jitter": typing.NotRequired[float | None],
    "search": typing.NotRequired[GreedySearchParamsDict | None],
    "det": typing.NotRequired[typing.Literal[-1, 1] | None],
    "cov_id": bool,
    "fixed_reslicing_image": typing.NotRequired[InputPathType | None],
    "reslice_moving_image": typing.NotRequired[GreedyResliceMovingImageParamsDict | None],
    "reslice_surface": typing.NotRequired[GreedyResliceSurfaceParamsDict | None],
    "interpolation": typing.NotRequired[typing.Union[GreedyNnParamsDictTagged, GreedyLinearParamsDictTagged, GreedyLabelParamsDictTagged] | None],
    "reslice_background": typing.NotRequired[float | None],
    "reslice_datatype": typing.NotRequired[typing.Literal["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"] | None],
    "reslice_composite": typing.NotRequired[InputPathType | None],
    "reslice_jacobian": typing.NotRequired[InputPathType | None],
    "reslice_simplex_jacobian": typing.NotRequired[GreedyResliceSimplexJacobianParamsDict | None],
    "reslice_mask": typing.NotRequired[InputPathType | None],
    "metric_gradient": typing.NotRequired[InputPathType | None],
    "debug_deriv": bool,
    "debug_deriv_eps": typing.NotRequired[float | None],
    "debug_aff_obj": bool,
    "dump_pyramid": bool,
    "dump_moving": bool,
    "dump_frequency": typing.NotRequired[float | None],
    "dump_prefix": typing.NotRequired[str | None],
    "powell": bool,
    "float": bool,
    "version": bool,
    "verbosity": typing.NotRequired[typing.Literal[0, 1, 2] | None],
})
GreedyParamsDict = _GreedyParamsDictNoTag | GreedyParamsDictTagged


def greedy_interpolation_cargs_dyn_fn(
    t: str,
) -> typing.Any:
    """
    Get build cargs function by command type.
    
    Args:
        t: Command type.
    Returns:
        Build cargs function.
    """
    return {
        "nn": greedy_nn_cargs,
        "linear": greedy_linear_cargs,
        "label": greedy_label_cargs,
    }.get(t)


def greedy_interpolation_validate_dyn_fn(
    t: str,
) -> typing.Any:
    """
    Get validate params function by command type.
    
    Args:
        t: Command type.
    Returns:
        Validate params function.
    """
    return {
        "nn": greedy_nn_validate,
        "linear": greedy_linear_validate,
        "label": greedy_label_validate,
    }.get(t)


def greedy_input_images(
    fixed: InputPathType,
    moving: InputPathType,
) -> GreedyInputImagesParamsDictTagged:
    """
    Build parameters.
    
    Args:
        fixed: The fixed image.
        moving: The moving image.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "input_images",
        "fixed": fixed,
        "moving": moving,
    }
    return params


def greedy_input_images_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyInputImagesParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("fixed", None) is None:
        raise StyxValidationError("`fixed` must not be None")
    if not isinstance(params["fixed"], (pathlib.Path, str)):
        raise StyxValidationError(f'`fixed` has the wrong type: Received `{type(params.get("fixed", None))}` expected `InputPathType`')
    if params.get("moving", None) is None:
        raise StyxValidationError("`moving` must not be None")
    if not isinstance(params["moving"], (pathlib.Path, str)):
        raise StyxValidationError(f'`moving` has the wrong type: Received `{type(params.get("moving", None))}` expected `InputPathType`')


def greedy_input_images_cargs(
    params: GreedyInputImagesParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("fixed", None)))
    cargs.append(execution.input_file(params.get("moving", None)))
    return cargs


class GreedyInvertOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyInvertParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    inverted_warp: OutputPathType
    """The inverted warp file"""


def greedy_invert(
    inwarp: InputPathType,
    outwarp: str,
) -> GreedyInvertParamsDictTagged:
    """
    Build parameters.
    
    Args:
        inwarp: The input warp to be inverted.
        outwarp: The filename for the inverted warp output.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "invert",
        "inwarp": inwarp,
        "outwarp": outwarp,
    }
    return params


def greedy_invert_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyInvertParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("inwarp", None) is None:
        raise StyxValidationError("`inwarp` must not be None")
    if not isinstance(params["inwarp"], (pathlib.Path, str)):
        raise StyxValidationError(f'`inwarp` has the wrong type: Received `{type(params.get("inwarp", None))}` expected `InputPathType`')
    if params.get("outwarp", None) is None:
        raise StyxValidationError("`outwarp` must not be None")
    if not isinstance(params["outwarp"], str):
        raise StyxValidationError(f'`outwarp` has the wrong type: Received `{type(params.get("outwarp", None))}` expected `str`')


def greedy_invert_cargs(
    params: GreedyInvertParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("inwarp", None)))
    cargs.append(params.get("outwarp", None))
    return cargs


def greedy_invert_outputs(
    params: GreedyInvertParamsDict,
    execution: Execution,
) -> GreedyInvertOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyInvertOutputs(
        root=execution.output_file("."),
        inverted_warp=execution.output_file(params.get("outwarp", None)),
    )
    return ret


class GreedyRootOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyRootParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    root_warp: OutputPathType
    """The 2^N-th root of the input warp"""


def greedy_root(
    inwarp: InputPathType,
    outwarp: str,
    n: int,
) -> GreedyRootParamsDictTagged:
    """
    Build parameters.
    
    Args:
        inwarp: The input warp.
        outwarp: The filename for the root warp output.
        n: The value of N for 2^N-th root.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "root",
        "inwarp": inwarp,
        "outwarp": outwarp,
        "n": n,
    }
    return params


def greedy_root_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyRootParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("inwarp", None) is None:
        raise StyxValidationError("`inwarp` must not be None")
    if not isinstance(params["inwarp"], (pathlib.Path, str)):
        raise StyxValidationError(f'`inwarp` has the wrong type: Received `{type(params.get("inwarp", None))}` expected `InputPathType`')
    if params.get("outwarp", None) is None:
        raise StyxValidationError("`outwarp` must not be None")
    if not isinstance(params["outwarp"], str):
        raise StyxValidationError(f'`outwarp` has the wrong type: Received `{type(params.get("outwarp", None))}` expected `str`')
    if params.get("n", None) is None:
        raise StyxValidationError("`n` must not be None")
    if not isinstance(params["n"], int):
        raise StyxValidationError(f'`n` has the wrong type: Received `{type(params.get("n", None))}` expected `int`')


def greedy_root_cargs(
    params: GreedyRootParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("inwarp", None)))
    cargs.append(params.get("outwarp", None))
    cargs.append(str(params.get("n", None)))
    return cargs


def greedy_root_outputs(
    params: GreedyRootParamsDict,
    execution: Execution,
) -> GreedyRootOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyRootOutputs(
        root=execution.output_file("."),
        root_warp=execution.output_file(params.get("outwarp", None)),
    )
    return ret


class GreedyJacobianOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyJacobianParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    jacobian_determinant: OutputPathType
    """The Jacobian determinant of the warp"""


def greedy_jacobian(
    inwarp: InputPathType,
    outjac: str,
) -> GreedyJacobianParamsDictTagged:
    """
    Build parameters.
    
    Args:
        inwarp: The input warp.
        outjac: The filename for the Jacobian determinant output.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "jacobian",
        "inwarp": inwarp,
        "outjac": outjac,
    }
    return params


def greedy_jacobian_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyJacobianParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("inwarp", None) is None:
        raise StyxValidationError("`inwarp` must not be None")
    if not isinstance(params["inwarp"], (pathlib.Path, str)):
        raise StyxValidationError(f'`inwarp` has the wrong type: Received `{type(params.get("inwarp", None))}` expected `InputPathType`')
    if params.get("outjac", None) is None:
        raise StyxValidationError("`outjac` must not be None")
    if not isinstance(params["outjac"], str):
        raise StyxValidationError(f'`outjac` has the wrong type: Received `{type(params.get("outjac", None))}` expected `str`')


def greedy_jacobian_cargs(
    params: GreedyJacobianParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("inwarp", None)))
    cargs.append(params.get("outjac", None))
    return cargs


def greedy_jacobian_outputs(
    params: GreedyJacobianParamsDict,
    execution: Execution,
) -> GreedyJacobianOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyJacobianOutputs(
        root=execution.output_file("."),
        jacobian_determinant=execution.output_file(params.get("outjac", None)),
    )
    return ret


def greedy_metric(
    metric_type: typing.Literal["SSD", "MI", "NMI", "NCC", "MAHAL"],
    metric_param: float | None = None,
) -> GreedyMetricParamsDictTagged:
    """
    Build parameters.
    
    Args:
        metric_type: Type of metric to use.
        metric_param: Parameter for the metric (e.g., radius for NCC).
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "metric",
        "metric_type": metric_type,
    }
    if metric_param is not None:
        params["metric_param"] = metric_param
    return params


def greedy_metric_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyMetricParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("metric_type", None) is None:
        raise StyxValidationError("`metric_type` must not be None")
    if not isinstance(params["metric_type"], str):
        raise StyxValidationError(f'`metric_type` has the wrong type: Received `{type(params.get("metric_type", None))}` expected `typing.Literal["SSD", "MI", "NMI", "NCC", "MAHAL"]`')
    if params["metric_type"] not in ["SSD", "MI", "NMI", "NCC", "MAHAL"]:
        raise StyxValidationError("Parameter `metric_type` must be one of [\"SSD\", \"MI\", \"NMI\", \"NCC\", \"MAHAL\"]")
    if params.get("metric_param", None) is not None:
        if not isinstance(params["metric_param"], (float, int)):
            raise StyxValidationError(f'`metric_param` has the wrong type: Received `{type(params.get("metric_param", None))}` expected `float | None`')


def greedy_metric_cargs(
    params: GreedyMetricParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(params.get("metric_type", None))
    if params.get("metric_param", None) is not None:
        cargs.append(str(params.get("metric_param", None)))
    return cargs


def greedy_tjr(
    mesh: InputPathType,
    weight: float,
) -> GreedyTjrParamsDictTagged:
    """
    Build parameters.
    
    Args:
        mesh: The tetrahedral mesh file.
        weight: The weight of the penalty term.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "tjr",
        "mesh": mesh,
        "weight": weight,
    }
    return params


def greedy_tjr_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyTjrParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("mesh", None) is None:
        raise StyxValidationError("`mesh` must not be None")
    if not isinstance(params["mesh"], (pathlib.Path, str)):
        raise StyxValidationError(f'`mesh` has the wrong type: Received `{type(params.get("mesh", None))}` expected `InputPathType`')
    if params.get("weight", None) is None:
        raise StyxValidationError("`weight` must not be None")
    if not isinstance(params["weight"], (float, int)):
        raise StyxValidationError(f'`weight` has the wrong type: Received `{type(params.get("weight", None))}` expected `float`')


def greedy_tjr_cargs(
    params: GreedyTjrParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("mesh", None)))
    cargs.append(str(params.get("weight", None)))
    return cargs


def greedy_search(
    n: int,
    rot: str,
    tran: float,
) -> GreedySearchParamsDictTagged:
    """
    Build parameters.
    
    Args:
        n: Number of iterations for random search.
        rot: Standard deviation of random rotation angle (degrees) or 'any' or\
            'flip'.
        tran: Standard deviation of random offset in physical units.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "search",
        "n": n,
        "rot": rot,
        "tran": tran,
    }
    return params


def greedy_search_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedySearchParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("n", None) is None:
        raise StyxValidationError("`n` must not be None")
    if not isinstance(params["n"], int):
        raise StyxValidationError(f'`n` has the wrong type: Received `{type(params.get("n", None))}` expected `int`')
    if params.get("rot", None) is None:
        raise StyxValidationError("`rot` must not be None")
    if not isinstance(params["rot"], str):
        raise StyxValidationError(f'`rot` has the wrong type: Received `{type(params.get("rot", None))}` expected `str`')
    if params.get("tran", None) is None:
        raise StyxValidationError("`tran` must not be None")
    if not isinstance(params["tran"], (float, int)):
        raise StyxValidationError(f'`tran` has the wrong type: Received `{type(params.get("tran", None))}` expected `float`')


def greedy_search_cargs(
    params: GreedySearchParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(str(params.get("n", None)))
    cargs.append(params.get("rot", None))
    cargs.append(str(params.get("tran", None)))
    return cargs


class GreedyResliceMovingImageOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyResliceMovingImageParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    resliced_image: OutputPathType
    """The resliced output image"""


def greedy_reslice_moving_image(
    moving: InputPathType,
    output: str,
) -> GreedyResliceMovingImageParamsDictTagged:
    """
    Build parameters.
    
    Args:
        moving: The moving image to be resliced.
        output: The filename for the resliced output image.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "reslice_moving_image",
        "moving": moving,
        "output": output,
    }
    return params


def greedy_reslice_moving_image_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyResliceMovingImageParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("moving", None) is None:
        raise StyxValidationError("`moving` must not be None")
    if not isinstance(params["moving"], (pathlib.Path, str)):
        raise StyxValidationError(f'`moving` has the wrong type: Received `{type(params.get("moving", None))}` expected `InputPathType`')
    if params.get("output", None) is None:
        raise StyxValidationError("`output` must not be None")
    if not isinstance(params["output"], str):
        raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')


def greedy_reslice_moving_image_cargs(
    params: GreedyResliceMovingImageParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("moving", None)))
    cargs.append(params.get("output", None))
    return cargs


def greedy_reslice_moving_image_outputs(
    params: GreedyResliceMovingImageParamsDict,
    execution: Execution,
) -> GreedyResliceMovingImageOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyResliceMovingImageOutputs(
        root=execution.output_file("."),
        resliced_image=execution.output_file(params.get("output", None)),
    )
    return ret


class GreedyResliceSurfaceOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyResliceSurfaceParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    warped_mesh: OutputPathType
    """The warped output mesh"""


def greedy_reslice_surface(
    inmesh: InputPathType,
    outmesh: str,
) -> GreedyResliceSurfaceParamsDictTagged:
    """
    Build parameters.
    
    Args:
        inmesh: The input mesh file.
        outmesh: The filename for the output warped mesh.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "reslice_surface",
        "inmesh": inmesh,
        "outmesh": outmesh,
    }
    return params


def greedy_reslice_surface_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyResliceSurfaceParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("inmesh", None) is None:
        raise StyxValidationError("`inmesh` must not be None")
    if not isinstance(params["inmesh"], (pathlib.Path, str)):
        raise StyxValidationError(f'`inmesh` has the wrong type: Received `{type(params.get("inmesh", None))}` expected `InputPathType`')
    if params.get("outmesh", None) is None:
        raise StyxValidationError("`outmesh` must not be None")
    if not isinstance(params["outmesh"], str):
        raise StyxValidationError(f'`outmesh` has the wrong type: Received `{type(params.get("outmesh", None))}` expected `str`')


def greedy_reslice_surface_cargs(
    params: GreedyResliceSurfaceParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("inmesh", None)))
    cargs.append(params.get("outmesh", None))
    return cargs


def greedy_reslice_surface_outputs(
    params: GreedyResliceSurfaceParamsDict,
    execution: Execution,
) -> GreedyResliceSurfaceOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyResliceSurfaceOutputs(
        root=execution.output_file("."),
        warped_mesh=execution.output_file(params.get("outmesh", None)),
    )
    return ret


def greedy_nn(
) -> GreedyNnParamsDictTagged:
    """
    Build parameters.
    
    Args:
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "nn",
    }
    return params


def greedy_nn_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyNnParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')


def greedy_nn_cargs(
    params: GreedyNnParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append("NN")
    return cargs


def greedy_linear(
) -> GreedyLinearParamsDictTagged:
    """
    Build parameters.
    
    Args:
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "linear",
    }
    return params


def greedy_linear_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyLinearParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')


def greedy_linear_cargs(
    params: GreedyLinearParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append("LINEAR")
    return cargs


def greedy_label(
    sigma_spec: str,
) -> GreedyLabelParamsDictTagged:
    """
    Build parameters.
    
    Args:
        sigma_spec: The <sigma_spec> parameter to the -ri LABEL command\
            specifies the standard deviation of the Gaussian kernel used to smooth\
            the labels. It can be provided in voxel units (e.g., 0.2vox) or\
            millimeter units (e.g., 0.2mm). Value of 0.2vox works well in most\
            situations.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "label",
        "sigma_spec": sigma_spec,
    }
    return params


def greedy_label_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyLabelParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("sigma_spec", None) is None:
        raise StyxValidationError("`sigma_spec` must not be None")
    if not isinstance(params["sigma_spec"], str):
        raise StyxValidationError(f'`sigma_spec` has the wrong type: Received `{type(params.get("sigma_spec", None))}` expected `str`')


def greedy_label_cargs(
    params: GreedyLabelParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append("LABEL")
    cargs.append(params.get("sigma_spec", None))
    return cargs


class GreedyResliceSimplexJacobianOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyResliceSimplexJacobianParamsDict | None(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    jacobian_mesh: OutputPathType
    """The output mesh with computed Jacobian determinants"""


def greedy_reslice_simplex_jacobian(
    inmesh: InputPathType,
    outmesh: str,
) -> GreedyResliceSimplexJacobianParamsDictTagged:
    """
    Build parameters.
    
    Args:
        inmesh: The input simplex mesh file.
        outmesh: The filename for the output mesh with Jacobian determinants.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "reslice_simplex_jacobian",
        "inmesh": inmesh,
        "outmesh": outmesh,
    }
    return params


def greedy_reslice_simplex_jacobian_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyResliceSimplexJacobianParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("inmesh", None) is None:
        raise StyxValidationError("`inmesh` must not be None")
    if not isinstance(params["inmesh"], (pathlib.Path, str)):
        raise StyxValidationError(f'`inmesh` has the wrong type: Received `{type(params.get("inmesh", None))}` expected `InputPathType`')
    if params.get("outmesh", None) is None:
        raise StyxValidationError("`outmesh` must not be None")
    if not isinstance(params["outmesh"], str):
        raise StyxValidationError(f'`outmesh` has the wrong type: Received `{type(params.get("outmesh", None))}` expected `str`')


def greedy_reslice_simplex_jacobian_cargs(
    params: GreedyResliceSimplexJacobianParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append(execution.input_file(params.get("inmesh", None)))
    cargs.append(params.get("outmesh", None))
    return cargs


def greedy_reslice_simplex_jacobian_outputs(
    params: GreedyResliceSimplexJacobianParamsDict,
    execution: Execution,
) -> GreedyResliceSimplexJacobianOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyResliceSimplexJacobianOutputs(
        root=execution.output_file("."),
        jacobian_mesh=execution.output_file(params.get("outmesh", None)),
    )
    return ret


class GreedyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `GreedyParamsDict(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType | None
    """Output file from affine or deformable registration"""
    invert: GreedyInvertOutputs | None
    """Outputs from `greedy_invert_outputs`."""
    root_: GreedyRootOutputs | None
    """Outputs from `greedy_root_outputs`."""
    jacobian: GreedyJacobianOutputs | None
    """Outputs from `greedy_jacobian_outputs`."""
    reslice_moving_image: GreedyResliceMovingImageOutputs | None
    """Outputs from `greedy_reslice_moving_image_outputs`."""
    reslice_surface: GreedyResliceSurfaceOutputs | None
    """Outputs from `greedy_reslice_surface_outputs`."""
    reslice_simplex_jacobian: GreedyResliceSimplexJacobianOutputs | None
    """Outputs from `greedy_reslice_simplex_jacobian_outputs`."""


def greedy_params(
    dimensions: int,
    input_images: GreedyInputImagesParamsDict | None = None,
    output: str | None = None,
    affine: bool = False,
    brute: str | None = None,
    moments: typing.Literal[1, 2] | None = None,
    reslice: list[InputPathType] | None = None,
    invert: GreedyInvertParamsDict | None = None,
    root: GreedyRootParamsDict | None = None,
    jacobian: GreedyJacobianParamsDict | None = None,
    metric_mode: bool = False,
    defopt: bool = False,
    weight: float | None = None,
    metric: GreedyMetricParamsDict | None = None,
    step_size: str | None = None,
    iterations: str | None = None,
    threads: int | None = None,
    fixed_mask: InputPathType | None = None,
    gm_trim: float | None = None,
    moving_mask: InputPathType | None = None,
    wncc_mask_dilate: bool = False,
    reference_image: InputPathType | None = None,
    ref_pad: float | None = None,
    background: str | None = None,
    input_transform: InputPathType | None = None,
    zero_last_dimension: bool = False,
    time_step_mode: typing.Literal["CONST", "SCALE", "SCALEDOWN"] | None = None,
    smoothing: str | None = None,
    inverse_warp: InputPathType | None = None,
    root_warp: InputPathType | None = None,
    warp_precision: float | None = None,
    noise: float | None = None,
    exponent: float | None = None,
    svf_mode: bool = False,
    svlb: bool = False,
    sv_incompr: bool = False,
    initial_warp: InputPathType | None = None,
    tjr: GreedyTjrParamsDict | None = None,
    wr: float | None = None,
    initial_affine: InputPathType | None = None,
    ia_identity: bool = False,
    ia_voxel_grid: bool = False,
    ia_image_centers: bool = False,
    ia_image_side: str | None = None,
    ia_moments: typing.Literal[1, 2] | None = None,
    affine_dof: typing.Literal[6, 7, 12] | None = None,
    jitter: float | None = None,
    search: GreedySearchParamsDict | None = None,
    det: typing.Literal[-1, 1] | None = None,
    cov_id: bool = False,
    fixed_reslicing_image: InputPathType | None = None,
    reslice_moving_image: GreedyResliceMovingImageParamsDict | None = None,
    reslice_surface: GreedyResliceSurfaceParamsDict | None = None,
    interpolation: typing.Union[GreedyNnParamsDictTagged, GreedyLinearParamsDictTagged, GreedyLabelParamsDictTagged] | None = None,
    reslice_background: float | None = None,
    reslice_datatype: typing.Literal["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"] | None = None,
    reslice_composite: InputPathType | None = None,
    reslice_jacobian: InputPathType | None = None,
    reslice_simplex_jacobian: GreedyResliceSimplexJacobianParamsDict | None = None,
    reslice_mask: InputPathType | None = None,
    metric_gradient: InputPathType | None = None,
    debug_deriv: bool = False,
    debug_deriv_eps: float | None = None,
    debug_aff_obj: bool = False,
    dump_pyramid: bool = False,
    dump_moving: bool = False,
    dump_frequency: float | None = None,
    dump_prefix: str | None = None,
    powell: bool = False,
    float_: bool = False,
    version: bool = False,
    verbosity: typing.Literal[0, 1, 2] | None = None,
) -> GreedyParamsDictTagged:
    """
    Build parameters.
    
    Args:
        dimensions: Number of image dimensions.
        input_images: Image pair (may be repeated).
        output: Output file (matrix in affine mode; image in deformable mode,\
            metric computation mode; ignored in reslicing mode).
        affine: Perform affine registration and save to output (-o).
        brute: Perform a brute force search around each voxel.
        moments: Perform moments of inertia rigid alignment of given order (1\
            or 2).
        reslice: Reslice images instead of doing registration.
        invert: Invert previously computed warp.
        root: Convert 2^N-th root of a warp.
        jacobian: Compute the Jacobian determinant of the warp.
        metric_mode: Compute metric between images.
        defopt: Deformable optimization mode (experimental).
        weight: Weight of the next -i pair.
        metric: Metric for the entire registration.
        step_size: Step size for optimization (default = 1.0), may also be\
            specified per level (e.g. 0.3x0.1).
        iterations: Number of iterations per level of multi-res.
        threads: Number of allowed concurrent threads.
        fixed_mask: Fixed image mask (metric gradients computed only over the\
            mask).
        gm_trim: Generate the fixed image mask by trimming the extent of the\
            fixed image by given radius.
        moving_mask: Moving image mask (pixels outside are excluded from metric\
            computation).
        wncc_mask_dilate: Specifies that fixed and moving masks should be\
            dilated by the radius of the WNCC metric during registration.
        reference_image: Use supplied image, rather than fixed image to define\
            the reference space.
        ref_pad: Define the reference space by padding the fixed image by\
            radius.
        background: Value to fill missing values when mapping fixed and moving\
            images to reference space.
        input_transform: Specify transforms (matrices, warps) that map moving\
            image to reference space.
        zero_last_dimension: Sets sigmas and NCC radius to zero in the last\
            dimension for 2D/3D registration.
        time_step_mode: Time step behavior mode.
        smoothing: Smoothing for the greedy update step (e.g., '1.732vox\
            0.7071vox').
        inverse_warp: Compute and write the inverse of the warp field.
        root_warp: Compute and write the (2^N-th) root of the warp field.
        warp_precision: Saved warp precision in voxels (default=0.1; 0 for no\
            compression).
        noise: Standard deviation of white noise added to moving/fixed images\
            when using NCC metric.
        exponent: The exponent used for warp inversion, root computation, and\
            in stationary velocity field mode.
        svf_mode: Perform registration using the stationary velocity model.
        svlb: Use more accurate but expensive update of v in stationary\
            velocity field mode.
        sv_incompr: Incompressibility mode, implements Mansi et al. 2011\
            iLogDemons.
        initial_warp: Specifies the initial warp to start iteration from.
        tjr: Apply a regularization penalty based on the Jacobian of a\
            tetrahedral mesh.
        wr: Weight of SVF smoothness regularization term (default: 1000).
        initial_affine: Initial affine matrix for optimization.
        ia_identity: Initialize affine matrix based on NIFTI headers.
        ia_voxel_grid: Initialize affine matrix so that voxels with\
            corresponding indices align.
        ia_image_centers: Initialize affine matrix based on matching image\
            centers.
        ia_image_side: Initialize affine matrix based on matching center of one\
            image side.
        ia_moments: Initialize affine matrix based on matching moments of\
            inertia.
        affine_dof: Degrees of freedom for affine registration. 6=rigid,\
            7=similarity, 12=affine.
        jitter: Jitter (in voxel units) applied to sample points (default: 0.5).
        search: Random search over rigid transforms before starting\
            optimization.
        det: Force the determinant of transform to be either 1 (no flip) or -1\
            (flip).
        cov_id: Assume identity covariance (match centers and do flips only, no\
            rotation).
        fixed_reslicing_image: Fixed image for reslicing.
        reslice_moving_image: Moving/output image pair for reslicing.
        reslice_surface: Fixed/output surface pair (vertices are warped from\
            fixed space to moving).
        interpolation: Interpolation for the next pair (NN, LINEAR*, LABEL\
            sigma).
        reslice_background: Background (i.e. outside) intensity for the next\
            pair (default 0).
        reslice_datatype: Data type for the next pair.
        reslice_composite: Write composed transforms to outwarp.
        reslice_jacobian: Write Jacobian determinant image to outjacobian.
        reslice_simplex_jacobian: Compute Jacobian determinant for a simplex\
            mesh in fixed space.
        reslice_mask: A binary mask for the fixed image; zero values will be\
            overwritten with background.
        metric_gradient: Write the gradient of the metric to file.
        debug_deriv: Enable periodic checks of derivatives (debug).
        debug_deriv_eps: Epsilon for derivative debugging.
        debug_aff_obj: Plot affine objective in neighborhood of -ia matrix.
        dump_pyramid: Dump the image pyramid at the start of the registration.
        dump_moving: Dump moving image at each iter.
        dump_frequency: Dump frequency.
        dump_prefix: Prefix for dump files (may be a path).
        powell: Use Powell's method instead of LGBFS.
        float_: Use single precision floating point (off by default).
        version: Print version info.
        verbosity: Verbosity level (0: none, 1: default, 2: verbose).
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "greedy/greedy",
        "dimensions": dimensions,
        "affine": affine,
        "metric_mode": metric_mode,
        "defopt": defopt,
        "wncc_mask_dilate": wncc_mask_dilate,
        "zero_last_dimension": zero_last_dimension,
        "svf_mode": svf_mode,
        "svlb": svlb,
        "sv_incompr": sv_incompr,
        "ia_identity": ia_identity,
        "ia_voxel_grid": ia_voxel_grid,
        "ia_image_centers": ia_image_centers,
        "cov_id": cov_id,
        "debug_deriv": debug_deriv,
        "debug_aff_obj": debug_aff_obj,
        "dump_pyramid": dump_pyramid,
        "dump_moving": dump_moving,
        "powell": powell,
        "float": float_,
        "version": version,
    }
    if input_images is not None:
        params["input_images"] = input_images
    if output is not None:
        params["output"] = output
    if brute is not None:
        params["brute"] = brute
    if moments is not None:
        params["moments"] = moments
    if reslice is not None:
        params["reslice"] = reslice
    if invert is not None:
        params["invert"] = invert
    if root is not None:
        params["root"] = root
    if jacobian is not None:
        params["jacobian"] = jacobian
    if weight is not None:
        params["weight"] = weight
    if metric is not None:
        params["metric"] = metric
    if step_size is not None:
        params["step_size"] = step_size
    if iterations is not None:
        params["iterations"] = iterations
    if threads is not None:
        params["threads"] = threads
    if fixed_mask is not None:
        params["fixed_mask"] = fixed_mask
    if gm_trim is not None:
        params["gm_trim"] = gm_trim
    if moving_mask is not None:
        params["moving_mask"] = moving_mask
    if reference_image is not None:
        params["reference_image"] = reference_image
    if ref_pad is not None:
        params["ref_pad"] = ref_pad
    if background is not None:
        params["background"] = background
    if input_transform is not None:
        params["input_transform"] = input_transform
    if time_step_mode is not None:
        params["time_step_mode"] = time_step_mode
    if smoothing is not None:
        params["smoothing"] = smoothing
    if inverse_warp is not None:
        params["inverse_warp"] = inverse_warp
    if root_warp is not None:
        params["root_warp"] = root_warp
    if warp_precision is not None:
        params["warp_precision"] = warp_precision
    if noise is not None:
        params["noise"] = noise
    if exponent is not None:
        params["exponent"] = exponent
    if initial_warp is not None:
        params["initial_warp"] = initial_warp
    if tjr is not None:
        params["tjr"] = tjr
    if wr is not None:
        params["wr"] = wr
    if initial_affine is not None:
        params["initial_affine"] = initial_affine
    if ia_image_side is not None:
        params["ia_image_side"] = ia_image_side
    if ia_moments is not None:
        params["ia_moments"] = ia_moments
    if affine_dof is not None:
        params["affine_dof"] = affine_dof
    if jitter is not None:
        params["jitter"] = jitter
    if search is not None:
        params["search"] = search
    if det is not None:
        params["det"] = det
    if fixed_reslicing_image is not None:
        params["fixed_reslicing_image"] = fixed_reslicing_image
    if reslice_moving_image is not None:
        params["reslice_moving_image"] = reslice_moving_image
    if reslice_surface is not None:
        params["reslice_surface"] = reslice_surface
    if interpolation is not None:
        params["interpolation"] = interpolation
    if reslice_background is not None:
        params["reslice_background"] = reslice_background
    if reslice_datatype is not None:
        params["reslice_datatype"] = reslice_datatype
    if reslice_composite is not None:
        params["reslice_composite"] = reslice_composite
    if reslice_jacobian is not None:
        params["reslice_jacobian"] = reslice_jacobian
    if reslice_simplex_jacobian is not None:
        params["reslice_simplex_jacobian"] = reslice_simplex_jacobian
    if reslice_mask is not None:
        params["reslice_mask"] = reslice_mask
    if metric_gradient is not None:
        params["metric_gradient"] = metric_gradient
    if debug_deriv_eps is not None:
        params["debug_deriv_eps"] = debug_deriv_eps
    if dump_frequency is not None:
        params["dump_frequency"] = dump_frequency
    if dump_prefix is not None:
        params["dump_prefix"] = dump_prefix
    if verbosity is not None:
        params["verbosity"] = verbosity
    return params


def greedy_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `GreedyParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("dimensions", None) is None:
        raise StyxValidationError("`dimensions` must not be None")
    if not isinstance(params["dimensions"], int):
        raise StyxValidationError(f'`dimensions` has the wrong type: Received `{type(params.get("dimensions", None))}` expected `int`')
    if params.get("input_images", None) is not None:
        greedy_input_images_validate(params["input_images"])
    if params.get("output", None) is not None:
        if not isinstance(params["output"], str):
            raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str | None`')
    if params.get("affine", False) is None:
        raise StyxValidationError("`affine` must not be None")
    if not isinstance(params["affine"], bool):
        raise StyxValidationError(f'`affine` has the wrong type: Received `{type(params.get("affine", False))}` expected `bool`')
    if params.get("brute", None) is not None:
        if not isinstance(params["brute"], str):
            raise StyxValidationError(f'`brute` has the wrong type: Received `{type(params.get("brute", None))}` expected `str | None`')
    if params.get("moments", None) is not None:
        if not isinstance(params["moments"], int):
            raise StyxValidationError(f'`moments` has the wrong type: Received `{type(params.get("moments", None))}` expected `typing.Literal[1, 2] | None`')
        if params["moments"] not in [1, 2]:
            raise StyxValidationError("Parameter `moments` must be one of [1, 2]")
    if params.get("reslice", None) is not None:
        if not isinstance(params["reslice"], list):
            raise StyxValidationError(f'`reslice` has the wrong type: Received `{type(params.get("reslice", None))}` expected `list[InputPathType] | None`')
        for e in params["reslice"]:
            if not isinstance(e, (pathlib.Path, str)):
                raise StyxValidationError(f'`reslice` has the wrong type: Received `{type(params.get("reslice", None))}` expected `list[InputPathType] | None`')
    if params.get("invert", None) is not None:
        greedy_invert_validate(params["invert"])
    if params.get("root", None) is not None:
        greedy_root_validate(params["root"])
    if params.get("jacobian", None) is not None:
        greedy_jacobian_validate(params["jacobian"])
    if params.get("metric_mode", False) is None:
        raise StyxValidationError("`metric_mode` must not be None")
    if not isinstance(params["metric_mode"], bool):
        raise StyxValidationError(f'`metric_mode` has the wrong type: Received `{type(params.get("metric_mode", False))}` expected `bool`')
    if params.get("defopt", False) is None:
        raise StyxValidationError("`defopt` must not be None")
    if not isinstance(params["defopt"], bool):
        raise StyxValidationError(f'`defopt` has the wrong type: Received `{type(params.get("defopt", False))}` expected `bool`')
    if params.get("weight", None) is not None:
        if not isinstance(params["weight"], (float, int)):
            raise StyxValidationError(f'`weight` has the wrong type: Received `{type(params.get("weight", None))}` expected `float | None`')
    if params.get("metric", None) is not None:
        greedy_metric_validate(params["metric"])
    if params.get("step_size", None) is not None:
        if not isinstance(params["step_size"], str):
            raise StyxValidationError(f'`step_size` has the wrong type: Received `{type(params.get("step_size", None))}` expected `str | None`')
    if params.get("iterations", None) is not None:
        if not isinstance(params["iterations"], str):
            raise StyxValidationError(f'`iterations` has the wrong type: Received `{type(params.get("iterations", None))}` expected `str | None`')
    if params.get("threads", None) is not None:
        if not isinstance(params["threads"], int):
            raise StyxValidationError(f'`threads` has the wrong type: Received `{type(params.get("threads", None))}` expected `int | None`')
    if params.get("fixed_mask", None) is not None:
        if not isinstance(params["fixed_mask"], (pathlib.Path, str)):
            raise StyxValidationError(f'`fixed_mask` has the wrong type: Received `{type(params.get("fixed_mask", None))}` expected `InputPathType | None`')
    if params.get("gm_trim", None) is not None:
        if not isinstance(params["gm_trim"], (float, int)):
            raise StyxValidationError(f'`gm_trim` has the wrong type: Received `{type(params.get("gm_trim", None))}` expected `float | None`')
    if params.get("moving_mask", None) is not None:
        if not isinstance(params["moving_mask"], (pathlib.Path, str)):
            raise StyxValidationError(f'`moving_mask` has the wrong type: Received `{type(params.get("moving_mask", None))}` expected `InputPathType | None`')
    if params.get("wncc_mask_dilate", False) is None:
        raise StyxValidationError("`wncc_mask_dilate` must not be None")
    if not isinstance(params["wncc_mask_dilate"], bool):
        raise StyxValidationError(f'`wncc_mask_dilate` has the wrong type: Received `{type(params.get("wncc_mask_dilate", False))}` expected `bool`')
    if params.get("reference_image", None) is not None:
        if not isinstance(params["reference_image"], (pathlib.Path, str)):
            raise StyxValidationError(f'`reference_image` has the wrong type: Received `{type(params.get("reference_image", None))}` expected `InputPathType | None`')
    if params.get("ref_pad", None) is not None:
        if not isinstance(params["ref_pad"], (float, int)):
            raise StyxValidationError(f'`ref_pad` has the wrong type: Received `{type(params.get("ref_pad", None))}` expected `float | None`')
    if params.get("background", None) is not None:
        if not isinstance(params["background"], str):
            raise StyxValidationError(f'`background` has the wrong type: Received `{type(params.get("background", None))}` expected `str | None`')
    if params.get("input_transform", None) is not None:
        if not isinstance(params["input_transform"], (pathlib.Path, str)):
            raise StyxValidationError(f'`input_transform` has the wrong type: Received `{type(params.get("input_transform", None))}` expected `InputPathType | None`')
    if params.get("zero_last_dimension", False) is None:
        raise StyxValidationError("`zero_last_dimension` must not be None")
    if not isinstance(params["zero_last_dimension"], bool):
        raise StyxValidationError(f'`zero_last_dimension` has the wrong type: Received `{type(params.get("zero_last_dimension", False))}` expected `bool`')
    if params.get("time_step_mode", None) is not None:
        if not isinstance(params["time_step_mode"], str):
            raise StyxValidationError(f'`time_step_mode` has the wrong type: Received `{type(params.get("time_step_mode", None))}` expected `typing.Literal["CONST", "SCALE", "SCALEDOWN"] | None`')
        if params["time_step_mode"] not in ["CONST", "SCALE", "SCALEDOWN"]:
            raise StyxValidationError("Parameter `time_step_mode` must be one of [\"CONST\", \"SCALE\", \"SCALEDOWN\"]")
    if params.get("smoothing", None) is not None:
        if not isinstance(params["smoothing"], str):
            raise StyxValidationError(f'`smoothing` has the wrong type: Received `{type(params.get("smoothing", None))}` expected `str | None`')
    if params.get("inverse_warp", None) is not None:
        if not isinstance(params["inverse_warp"], (pathlib.Path, str)):
            raise StyxValidationError(f'`inverse_warp` has the wrong type: Received `{type(params.get("inverse_warp", None))}` expected `InputPathType | None`')
    if params.get("root_warp", None) is not None:
        if not isinstance(params["root_warp"], (pathlib.Path, str)):
            raise StyxValidationError(f'`root_warp` has the wrong type: Received `{type(params.get("root_warp", None))}` expected `InputPathType | None`')
    if params.get("warp_precision", None) is not None:
        if not isinstance(params["warp_precision"], (float, int)):
            raise StyxValidationError(f'`warp_precision` has the wrong type: Received `{type(params.get("warp_precision", None))}` expected `float | None`')
    if params.get("noise", None) is not None:
        if not isinstance(params["noise"], (float, int)):
            raise StyxValidationError(f'`noise` has the wrong type: Received `{type(params.get("noise", None))}` expected `float | None`')
    if params.get("exponent", None) is not None:
        if not isinstance(params["exponent"], (float, int)):
            raise StyxValidationError(f'`exponent` has the wrong type: Received `{type(params.get("exponent", None))}` expected `float | None`')
    if params.get("svf_mode", False) is None:
        raise StyxValidationError("`svf_mode` must not be None")
    if not isinstance(params["svf_mode"], bool):
        raise StyxValidationError(f'`svf_mode` has the wrong type: Received `{type(params.get("svf_mode", False))}` expected `bool`')
    if params.get("svlb", False) is None:
        raise StyxValidationError("`svlb` must not be None")
    if not isinstance(params["svlb"], bool):
        raise StyxValidationError(f'`svlb` has the wrong type: Received `{type(params.get("svlb", False))}` expected `bool`')
    if params.get("sv_incompr", False) is None:
        raise StyxValidationError("`sv_incompr` must not be None")
    if not isinstance(params["sv_incompr"], bool):
        raise StyxValidationError(f'`sv_incompr` has the wrong type: Received `{type(params.get("sv_incompr", False))}` expected `bool`')
    if params.get("initial_warp", None) is not None:
        if not isinstance(params["initial_warp"], (pathlib.Path, str)):
            raise StyxValidationError(f'`initial_warp` has the wrong type: Received `{type(params.get("initial_warp", None))}` expected `InputPathType | None`')
    if params.get("tjr", None) is not None:
        greedy_tjr_validate(params["tjr"])
    if params.get("wr", None) is not None:
        if not isinstance(params["wr"], (float, int)):
            raise StyxValidationError(f'`wr` has the wrong type: Received `{type(params.get("wr", None))}` expected `float | None`')
    if params.get("initial_affine", None) is not None:
        if not isinstance(params["initial_affine"], (pathlib.Path, str)):
            raise StyxValidationError(f'`initial_affine` has the wrong type: Received `{type(params.get("initial_affine", None))}` expected `InputPathType | None`')
    if params.get("ia_identity", False) is None:
        raise StyxValidationError("`ia_identity` must not be None")
    if not isinstance(params["ia_identity"], bool):
        raise StyxValidationError(f'`ia_identity` has the wrong type: Received `{type(params.get("ia_identity", False))}` expected `bool`')
    if params.get("ia_voxel_grid", False) is None:
        raise StyxValidationError("`ia_voxel_grid` must not be None")
    if not isinstance(params["ia_voxel_grid"], bool):
        raise StyxValidationError(f'`ia_voxel_grid` has the wrong type: Received `{type(params.get("ia_voxel_grid", False))}` expected `bool`')
    if params.get("ia_image_centers", False) is None:
        raise StyxValidationError("`ia_image_centers` must not be None")
    if not isinstance(params["ia_image_centers"], bool):
        raise StyxValidationError(f'`ia_image_centers` has the wrong type: Received `{type(params.get("ia_image_centers", False))}` expected `bool`')
    if params.get("ia_image_side", None) is not None:
        if not isinstance(params["ia_image_side"], str):
            raise StyxValidationError(f'`ia_image_side` has the wrong type: Received `{type(params.get("ia_image_side", None))}` expected `str | None`')
    if params.get("ia_moments", None) is not None:
        if not isinstance(params["ia_moments"], int):
            raise StyxValidationError(f'`ia_moments` has the wrong type: Received `{type(params.get("ia_moments", None))}` expected `typing.Literal[1, 2] | None`')
        if params["ia_moments"] not in [1, 2]:
            raise StyxValidationError("Parameter `ia_moments` must be one of [1, 2]")
    if params.get("affine_dof", None) is not None:
        if not isinstance(params["affine_dof"], int):
            raise StyxValidationError(f'`affine_dof` has the wrong type: Received `{type(params.get("affine_dof", None))}` expected `typing.Literal[6, 7, 12] | None`')
        if params["affine_dof"] not in [6, 7, 12]:
            raise StyxValidationError("Parameter `affine_dof` must be one of [6, 7, 12]")
    if params.get("jitter", None) is not None:
        if not isinstance(params["jitter"], (float, int)):
            raise StyxValidationError(f'`jitter` has the wrong type: Received `{type(params.get("jitter", None))}` expected `float | None`')
    if params.get("search", None) is not None:
        greedy_search_validate(params["search"])
    if params.get("det", None) is not None:
        if not isinstance(params["det"], int):
            raise StyxValidationError(f'`det` has the wrong type: Received `{type(params.get("det", None))}` expected `typing.Literal[-1, 1] | None`')
        if params["det"] not in [-1, 1]:
            raise StyxValidationError("Parameter `det` must be one of [-1, 1]")
    if params.get("cov_id", False) is None:
        raise StyxValidationError("`cov_id` must not be None")
    if not isinstance(params["cov_id"], bool):
        raise StyxValidationError(f'`cov_id` has the wrong type: Received `{type(params.get("cov_id", False))}` expected `bool`')
    if params.get("fixed_reslicing_image", None) is not None:
        if not isinstance(params["fixed_reslicing_image"], (pathlib.Path, str)):
            raise StyxValidationError(f'`fixed_reslicing_image` has the wrong type: Received `{type(params.get("fixed_reslicing_image", None))}` expected `InputPathType | None`')
    if params.get("reslice_moving_image", None) is not None:
        greedy_reslice_moving_image_validate(params["reslice_moving_image"])
    if params.get("reslice_surface", None) is not None:
        greedy_reslice_surface_validate(params["reslice_surface"])
    if params.get("interpolation", None) is not None:
        if not isinstance(params["interpolation"], dict):
            raise StyxValidationError(f'Params object has the wrong type \'{type(params["interpolation"])}\'')
        if "@type" not in params["interpolation"]:
            raise StyxValidationError("Params object is missing `@type`")
        if params["interpolation"]["@type"] not in ["nn", "linear", "label"]:
            raise StyxValidationError("Parameter `interpolation`s `@type` must be one of [\"nn\", \"linear\", \"label\"]")
        greedy_interpolation_validate_dyn_fn(params["interpolation"]["@type"])(params["interpolation"])
    if params.get("reslice_background", None) is not None:
        if not isinstance(params["reslice_background"], (float, int)):
            raise StyxValidationError(f'`reslice_background` has the wrong type: Received `{type(params.get("reslice_background", None))}` expected `float | None`')
    if params.get("reslice_datatype", None) is not None:
        if not isinstance(params["reslice_datatype"], str):
            raise StyxValidationError(f'`reslice_datatype` has the wrong type: Received `{type(params.get("reslice_datatype", None))}` expected `typing.Literal["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"] | None`')
        if params["reslice_datatype"] not in ["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"]:
            raise StyxValidationError("Parameter `reslice_datatype` must be one of [\"auto\", \"double\", \"float\", \"uint\", \"int\", \"ushort\", \"short\", \"uchar\", \"char\"]")
    if params.get("reslice_composite", None) is not None:
        if not isinstance(params["reslice_composite"], (pathlib.Path, str)):
            raise StyxValidationError(f'`reslice_composite` has the wrong type: Received `{type(params.get("reslice_composite", None))}` expected `InputPathType | None`')
    if params.get("reslice_jacobian", None) is not None:
        if not isinstance(params["reslice_jacobian"], (pathlib.Path, str)):
            raise StyxValidationError(f'`reslice_jacobian` has the wrong type: Received `{type(params.get("reslice_jacobian", None))}` expected `InputPathType | None`')
    if params.get("reslice_simplex_jacobian", None) is not None:
        greedy_reslice_simplex_jacobian_validate(params["reslice_simplex_jacobian"])
    if params.get("reslice_mask", None) is not None:
        if not isinstance(params["reslice_mask"], (pathlib.Path, str)):
            raise StyxValidationError(f'`reslice_mask` has the wrong type: Received `{type(params.get("reslice_mask", None))}` expected `InputPathType | None`')
    if params.get("metric_gradient", None) is not None:
        if not isinstance(params["metric_gradient"], (pathlib.Path, str)):
            raise StyxValidationError(f'`metric_gradient` has the wrong type: Received `{type(params.get("metric_gradient", None))}` expected `InputPathType | None`')
    if params.get("debug_deriv", False) is None:
        raise StyxValidationError("`debug_deriv` must not be None")
    if not isinstance(params["debug_deriv"], bool):
        raise StyxValidationError(f'`debug_deriv` has the wrong type: Received `{type(params.get("debug_deriv", False))}` expected `bool`')
    if params.get("debug_deriv_eps", None) is not None:
        if not isinstance(params["debug_deriv_eps"], (float, int)):
            raise StyxValidationError(f'`debug_deriv_eps` has the wrong type: Received `{type(params.get("debug_deriv_eps", None))}` expected `float | None`')
    if params.get("debug_aff_obj", False) is None:
        raise StyxValidationError("`debug_aff_obj` must not be None")
    if not isinstance(params["debug_aff_obj"], bool):
        raise StyxValidationError(f'`debug_aff_obj` has the wrong type: Received `{type(params.get("debug_aff_obj", False))}` expected `bool`')
    if params.get("dump_pyramid", False) is None:
        raise StyxValidationError("`dump_pyramid` must not be None")
    if not isinstance(params["dump_pyramid"], bool):
        raise StyxValidationError(f'`dump_pyramid` has the wrong type: Received `{type(params.get("dump_pyramid", False))}` expected `bool`')
    if params.get("dump_moving", False) is None:
        raise StyxValidationError("`dump_moving` must not be None")
    if not isinstance(params["dump_moving"], bool):
        raise StyxValidationError(f'`dump_moving` has the wrong type: Received `{type(params.get("dump_moving", False))}` expected `bool`')
    if params.get("dump_frequency", None) is not None:
        if not isinstance(params["dump_frequency"], (float, int)):
            raise StyxValidationError(f'`dump_frequency` has the wrong type: Received `{type(params.get("dump_frequency", None))}` expected `float | None`')
    if params.get("dump_prefix", None) is not None:
        if not isinstance(params["dump_prefix"], str):
            raise StyxValidationError(f'`dump_prefix` has the wrong type: Received `{type(params.get("dump_prefix", None))}` expected `str | None`')
    if params.get("powell", False) is None:
        raise StyxValidationError("`powell` must not be None")
    if not isinstance(params["powell"], bool):
        raise StyxValidationError(f'`powell` has the wrong type: Received `{type(params.get("powell", False))}` expected `bool`')
    if params.get("float", False) is None:
        raise StyxValidationError("`float` must not be None")
    if not isinstance(params["float"], bool):
        raise StyxValidationError(f'`float` has the wrong type: Received `{type(params.get("float", False))}` expected `bool`')
    if params.get("version", False) is None:
        raise StyxValidationError("`version` must not be None")
    if not isinstance(params["version"], bool):
        raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
    if params.get("verbosity", None) is not None:
        if not isinstance(params["verbosity"], int):
            raise StyxValidationError(f'`verbosity` has the wrong type: Received `{type(params.get("verbosity", None))}` expected `typing.Literal[0, 1, 2] | None`')
        if params["verbosity"] not in [0, 1, 2]:
            raise StyxValidationError("Parameter `verbosity` must be one of [0, 1, 2]")


def greedy_cargs(
    params: GreedyParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.append("greedy")
    cargs.extend([
        "-d",
        str(params.get("dimensions", None))
    ])
    if params.get("input_images", None) is not None:
        cargs.extend([
            "-i",
            *greedy_input_images_cargs(params.get("input_images", None), execution)
        ])
    if params.get("output", None) is not None:
        cargs.extend([
            "-o",
            params.get("output", None)
        ])
    if params.get("affine", False):
        cargs.append("-a")
    if params.get("brute", None) is not None:
        cargs.extend([
            "-brute",
            params.get("brute", None)
        ])
    if params.get("moments", None) is not None:
        cargs.extend([
            "-moments",
            str(params.get("moments", None))
        ])
    if params.get("reslice", None) is not None:
        cargs.extend([
            "-r",
            *[execution.input_file(f) for f in params.get("reslice", None)]
        ])
    if params.get("invert", None) is not None:
        cargs.extend([
            "-iw",
            *greedy_invert_cargs(params.get("invert", None), execution)
        ])
    if params.get("root", None) is not None:
        cargs.extend([
            "-root",
            *greedy_root_cargs(params.get("root", None), execution)
        ])
    if params.get("jacobian", None) is not None:
        cargs.extend([
            "-jac",
            *greedy_jacobian_cargs(params.get("jacobian", None), execution)
        ])
    if params.get("metric_mode", False):
        cargs.append("-metric")
    if params.get("defopt", False):
        cargs.append("-defopt")
    if params.get("weight", None) is not None:
        cargs.extend([
            "-w",
            str(params.get("weight", None))
        ])
    if params.get("metric", None) is not None:
        cargs.extend([
            "-m",
            *greedy_metric_cargs(params.get("metric", None), execution)
        ])
    if params.get("step_size", None) is not None:
        cargs.extend([
            "-e",
            params.get("step_size", None)
        ])
    if params.get("iterations", None) is not None:
        cargs.extend([
            "-n",
            params.get("iterations", None)
        ])
    if params.get("threads", None) is not None:
        cargs.extend([
            "-threads",
            str(params.get("threads", None))
        ])
    if params.get("fixed_mask", None) is not None:
        cargs.extend([
            "-gm",
            execution.input_file(params.get("fixed_mask", None))
        ])
    if params.get("gm_trim", None) is not None:
        cargs.extend([
            "-gm-trim",
            str(params.get("gm_trim", None))
        ])
    if params.get("moving_mask", None) is not None:
        cargs.extend([
            "-mm",
            execution.input_file(params.get("moving_mask", None))
        ])
    if params.get("wncc_mask_dilate", False):
        cargs.append("-wncc-mask-dilate")
    if params.get("reference_image", None) is not None:
        cargs.extend([
            "-ref",
            execution.input_file(params.get("reference_image", None))
        ])
    if params.get("ref_pad", None) is not None:
        cargs.extend([
            "-ref-pad",
            str(params.get("ref_pad", None))
        ])
    if params.get("background", None) is not None:
        cargs.extend([
            "-bg",
            params.get("background", None)
        ])
    if params.get("input_transform", None) is not None:
        cargs.extend([
            "-it",
            execution.input_file(params.get("input_transform", None))
        ])
    if params.get("zero_last_dimension", False):
        cargs.append("-z")
    if params.get("time_step_mode", None) is not None:
        cargs.extend([
            "-tscale",
            params.get("time_step_mode", None)
        ])
    if params.get("smoothing", None) is not None:
        cargs.extend([
            "-s",
            params.get("smoothing", None)
        ])
    if params.get("inverse_warp", None) is not None:
        cargs.extend([
            "-oinv",
            execution.input_file(params.get("inverse_warp", None))
        ])
    if params.get("root_warp", None) is not None:
        cargs.extend([
            "-oroot",
            execution.input_file(params.get("root_warp", None))
        ])
    if params.get("warp_precision", None) is not None:
        cargs.extend([
            "-wp",
            str(params.get("warp_precision", None))
        ])
    if params.get("noise", None) is not None:
        cargs.extend([
            "-noise",
            str(params.get("noise", None))
        ])
    if params.get("exponent", None) is not None:
        cargs.extend([
            "-exp",
            str(params.get("exponent", None))
        ])
    if params.get("svf_mode", False):
        cargs.append("-sv")
    if params.get("svlb", False):
        cargs.append("-svlb")
    if params.get("sv_incompr", False):
        cargs.append("-sv-incompr")
    if params.get("initial_warp", None) is not None:
        cargs.extend([
            "-id",
            execution.input_file(params.get("initial_warp", None))
        ])
    if params.get("tjr", None) is not None:
        cargs.extend([
            "-tjr",
            *greedy_tjr_cargs(params.get("tjr", None), execution)
        ])
    if params.get("wr", None) is not None:
        cargs.extend([
            "-wr",
            str(params.get("wr", None))
        ])
    if params.get("initial_affine", None) is not None:
        cargs.extend([
            "-ia",
            execution.input_file(params.get("initial_affine", None))
        ])
    if params.get("ia_identity", False):
        cargs.append("-ia-identity")
    if params.get("ia_voxel_grid", False):
        cargs.append("-ia-voxel-grid")
    if params.get("ia_image_centers", False):
        cargs.append("-ia-image-centers")
    if params.get("ia_image_side", None) is not None:
        cargs.extend([
            "-ia-image-side",
            params.get("ia_image_side", None)
        ])
    if params.get("ia_moments", None) is not None:
        cargs.extend([
            "-ia-moments",
            str(params.get("ia_moments", None))
        ])
    if params.get("affine_dof", None) is not None:
        cargs.extend([
            "-dof",
            str(params.get("affine_dof", None))
        ])
    if params.get("jitter", None) is not None:
        cargs.extend([
            "-jitter",
            str(params.get("jitter", None))
        ])
    if params.get("search", None) is not None:
        cargs.extend([
            "-search",
            *greedy_search_cargs(params.get("search", None), execution)
        ])
    if params.get("det", None) is not None:
        cargs.extend([
            "-det",
            str(params.get("det", None))
        ])
    if params.get("cov_id", False):
        cargs.append("-cov-id")
    if params.get("fixed_reslicing_image", None) is not None:
        cargs.extend([
            "-rf",
            execution.input_file(params.get("fixed_reslicing_image", None))
        ])
    if params.get("reslice_moving_image", None) is not None:
        cargs.extend([
            "-rm",
            *greedy_reslice_moving_image_cargs(params.get("reslice_moving_image", None), execution)
        ])
    if params.get("reslice_surface", None) is not None:
        cargs.extend([
            "-rs",
            *greedy_reslice_surface_cargs(params.get("reslice_surface", None), execution)
        ])
    if params.get("interpolation", None) is not None:
        cargs.extend([
            "-ri",
            *greedy_interpolation_cargs_dyn_fn(params.get("interpolation", None)["@type"])(params.get("interpolation", None), execution)
        ])
    if params.get("reslice_background", None) is not None:
        cargs.extend([
            "-rb",
            str(params.get("reslice_background", None))
        ])
    if params.get("reslice_datatype", None) is not None:
        cargs.extend([
            "-rt",
            params.get("reslice_datatype", None)
        ])
    if params.get("reslice_composite", None) is not None:
        cargs.extend([
            "-rc",
            execution.input_file(params.get("reslice_composite", None))
        ])
    if params.get("reslice_jacobian", None) is not None:
        cargs.extend([
            "-rj",
            execution.input_file(params.get("reslice_jacobian", None))
        ])
    if params.get("reslice_simplex_jacobian", None) is not None:
        cargs.extend([
            "-rsj",
            *greedy_reslice_simplex_jacobian_cargs(params.get("reslice_simplex_jacobian", None), execution)
        ])
    if params.get("reslice_mask", None) is not None:
        cargs.extend([
            "-rk",
            execution.input_file(params.get("reslice_mask", None))
        ])
    if params.get("metric_gradient", None) is not None:
        cargs.extend([
            "-og",
            execution.input_file(params.get("metric_gradient", None))
        ])
    if params.get("debug_deriv", False):
        cargs.append("-debug-deriv")
    if params.get("debug_deriv_eps", None) is not None:
        cargs.extend([
            "-debug-deriv-eps",
            str(params.get("debug_deriv_eps", None))
        ])
    if params.get("debug_aff_obj", False):
        cargs.append("-debug-aff-obj")
    if params.get("dump_pyramid", False):
        cargs.append("-dump-pyramid")
    if params.get("dump_moving", False):
        cargs.append("-dump-moving")
    if params.get("dump_frequency", None) is not None:
        cargs.extend([
            "-dump-freq",
            str(params.get("dump_frequency", None))
        ])
    if params.get("dump_prefix", None) is not None:
        cargs.extend([
            "-dump-prefix",
            params.get("dump_prefix", None)
        ])
    if params.get("powell", False):
        cargs.append("-powell")
    if params.get("float", False):
        cargs.append("-float")
    if params.get("version", False):
        cargs.append("-version")
    if params.get("verbosity", None) is not None:
        cargs.extend([
            "-V",
            str(params.get("verbosity", None))
        ])
    return cargs


def greedy_outputs(
    params: GreedyParamsDict,
    execution: Execution,
) -> GreedyOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = GreedyOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(params.get("output", None)) if (params.get("output") is not None) else None,
        invert=greedy_invert_outputs(params.get("invert"), execution) if params.get("invert") else None,
        root_=greedy_root_outputs(params.get("root"), execution) if params.get("root") else None,
        jacobian=greedy_jacobian_outputs(params.get("jacobian"), execution) if params.get("jacobian") else None,
        reslice_moving_image=greedy_reslice_moving_image_outputs(params.get("reslice_moving_image"), execution) if params.get("reslice_moving_image") else None,
        reslice_surface=greedy_reslice_surface_outputs(params.get("reslice_surface"), execution) if params.get("reslice_surface") else None,
        reslice_simplex_jacobian=greedy_reslice_simplex_jacobian_outputs(params.get("reslice_simplex_jacobian"), execution) if params.get("reslice_simplex_jacobian") else None,
    )
    return ret


def greedy_execute(
    params: GreedyParamsDict,
    runner: Runner | None = None,
) -> GreedyOutputs:
    """
    greedy
    
    Paul's greedy diffeomorphic registration implementation.
    
    Author: Greedy Developers
    
    URL: https://sites.google.com/view/greedyreg/about
    
    Args:
        params: The parameters.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `GreedyOutputs`).
    """
    greedy_validate(params)
    runner = runner or get_global_runner()
    execution = runner.start_execution(GREEDY_METADATA)
    params = execution.params(params)
    cargs = greedy_cargs(params, execution)
    ret = greedy_outputs(params, execution)
    execution.run(cargs)
    return ret


def greedy_(
    dimensions: int,
    input_images: GreedyInputImagesParamsDict | None = None,
    output: str | None = None,
    affine: bool = False,
    brute: str | None = None,
    moments: typing.Literal[1, 2] | None = None,
    reslice: list[InputPathType] | None = None,
    invert: GreedyInvertParamsDict | None = None,
    root: GreedyRootParamsDict | None = None,
    jacobian: GreedyJacobianParamsDict | None = None,
    metric_mode: bool = False,
    defopt: bool = False,
    weight: float | None = None,
    metric: GreedyMetricParamsDict | None = None,
    step_size: str | None = None,
    iterations: str | None = None,
    threads: int | None = None,
    fixed_mask: InputPathType | None = None,
    gm_trim: float | None = None,
    moving_mask: InputPathType | None = None,
    wncc_mask_dilate: bool = False,
    reference_image: InputPathType | None = None,
    ref_pad: float | None = None,
    background: str | None = None,
    input_transform: InputPathType | None = None,
    zero_last_dimension: bool = False,
    time_step_mode: typing.Literal["CONST", "SCALE", "SCALEDOWN"] | None = None,
    smoothing: str | None = None,
    inverse_warp: InputPathType | None = None,
    root_warp: InputPathType | None = None,
    warp_precision: float | None = None,
    noise: float | None = None,
    exponent: float | None = None,
    svf_mode: bool = False,
    svlb: bool = False,
    sv_incompr: bool = False,
    initial_warp: InputPathType | None = None,
    tjr: GreedyTjrParamsDict | None = None,
    wr: float | None = None,
    initial_affine: InputPathType | None = None,
    ia_identity: bool = False,
    ia_voxel_grid: bool = False,
    ia_image_centers: bool = False,
    ia_image_side: str | None = None,
    ia_moments: typing.Literal[1, 2] | None = None,
    affine_dof: typing.Literal[6, 7, 12] | None = None,
    jitter: float | None = None,
    search: GreedySearchParamsDict | None = None,
    det: typing.Literal[-1, 1] | None = None,
    cov_id: bool = False,
    fixed_reslicing_image: InputPathType | None = None,
    reslice_moving_image: GreedyResliceMovingImageParamsDict | None = None,
    reslice_surface: GreedyResliceSurfaceParamsDict | None = None,
    interpolation: typing.Union[GreedyNnParamsDictTagged, GreedyLinearParamsDictTagged, GreedyLabelParamsDictTagged] | None = None,
    reslice_background: float | None = None,
    reslice_datatype: typing.Literal["auto", "double", "float", "uint", "int", "ushort", "short", "uchar", "char"] | None = None,
    reslice_composite: InputPathType | None = None,
    reslice_jacobian: InputPathType | None = None,
    reslice_simplex_jacobian: GreedyResliceSimplexJacobianParamsDict | None = None,
    reslice_mask: InputPathType | None = None,
    metric_gradient: InputPathType | None = None,
    debug_deriv: bool = False,
    debug_deriv_eps: float | None = None,
    debug_aff_obj: bool = False,
    dump_pyramid: bool = False,
    dump_moving: bool = False,
    dump_frequency: float | None = None,
    dump_prefix: str | None = None,
    powell: bool = False,
    float_: bool = False,
    version: bool = False,
    verbosity: typing.Literal[0, 1, 2] | None = None,
    runner: Runner | None = None,
) -> GreedyOutputs:
    """
    greedy
    
    Paul's greedy diffeomorphic registration implementation.
    
    Author: Greedy Developers
    
    URL: https://sites.google.com/view/greedyreg/about
    
    Args:
        dimensions: Number of image dimensions.
        input_images: Image pair (may be repeated).
        output: Output file (matrix in affine mode; image in deformable mode,\
            metric computation mode; ignored in reslicing mode).
        affine: Perform affine registration and save to output (-o).
        brute: Perform a brute force search around each voxel.
        moments: Perform moments of inertia rigid alignment of given order (1\
            or 2).
        reslice: Reslice images instead of doing registration.
        invert: Invert previously computed warp.
        root: Convert 2^N-th root of a warp.
        jacobian: Compute the Jacobian determinant of the warp.
        metric_mode: Compute metric between images.
        defopt: Deformable optimization mode (experimental).
        weight: Weight of the next -i pair.
        metric: Metric for the entire registration.
        step_size: Step size for optimization (default = 1.0), may also be\
            specified per level (e.g. 0.3x0.1).
        iterations: Number of iterations per level of multi-res.
        threads: Number of allowed concurrent threads.
        fixed_mask: Fixed image mask (metric gradients computed only over the\
            mask).
        gm_trim: Generate the fixed image mask by trimming the extent of the\
            fixed image by given radius.
        moving_mask: Moving image mask (pixels outside are excluded from metric\
            computation).
        wncc_mask_dilate: Specifies that fixed and moving masks should be\
            dilated by the radius of the WNCC metric during registration.
        reference_image: Use supplied image, rather than fixed image to define\
            the reference space.
        ref_pad: Define the reference space by padding the fixed image by\
            radius.
        background: Value to fill missing values when mapping fixed and moving\
            images to reference space.
        input_transform: Specify transforms (matrices, warps) that map moving\
            image to reference space.
        zero_last_dimension: Sets sigmas and NCC radius to zero in the last\
            dimension for 2D/3D registration.
        time_step_mode: Time step behavior mode.
        smoothing: Smoothing for the greedy update step (e.g., '1.732vox\
            0.7071vox').
        inverse_warp: Compute and write the inverse of the warp field.
        root_warp: Compute and write the (2^N-th) root of the warp field.
        warp_precision: Saved warp precision in voxels (default=0.1; 0 for no\
            compression).
        noise: Standard deviation of white noise added to moving/fixed images\
            when using NCC metric.
        exponent: The exponent used for warp inversion, root computation, and\
            in stationary velocity field mode.
        svf_mode: Perform registration using the stationary velocity model.
        svlb: Use more accurate but expensive update of v in stationary\
            velocity field mode.
        sv_incompr: Incompressibility mode, implements Mansi et al. 2011\
            iLogDemons.
        initial_warp: Specifies the initial warp to start iteration from.
        tjr: Apply a regularization penalty based on the Jacobian of a\
            tetrahedral mesh.
        wr: Weight of SVF smoothness regularization term (default: 1000).
        initial_affine: Initial affine matrix for optimization.
        ia_identity: Initialize affine matrix based on NIFTI headers.
        ia_voxel_grid: Initialize affine matrix so that voxels with\
            corresponding indices align.
        ia_image_centers: Initialize affine matrix based on matching image\
            centers.
        ia_image_side: Initialize affine matrix based on matching center of one\
            image side.
        ia_moments: Initialize affine matrix based on matching moments of\
            inertia.
        affine_dof: Degrees of freedom for affine registration. 6=rigid,\
            7=similarity, 12=affine.
        jitter: Jitter (in voxel units) applied to sample points (default: 0.5).
        search: Random search over rigid transforms before starting\
            optimization.
        det: Force the determinant of transform to be either 1 (no flip) or -1\
            (flip).
        cov_id: Assume identity covariance (match centers and do flips only, no\
            rotation).
        fixed_reslicing_image: Fixed image for reslicing.
        reslice_moving_image: Moving/output image pair for reslicing.
        reslice_surface: Fixed/output surface pair (vertices are warped from\
            fixed space to moving).
        interpolation: Interpolation for the next pair (NN, LINEAR*, LABEL\
            sigma).
        reslice_background: Background (i.e. outside) intensity for the next\
            pair (default 0).
        reslice_datatype: Data type for the next pair.
        reslice_composite: Write composed transforms to outwarp.
        reslice_jacobian: Write Jacobian determinant image to outjacobian.
        reslice_simplex_jacobian: Compute Jacobian determinant for a simplex\
            mesh in fixed space.
        reslice_mask: A binary mask for the fixed image; zero values will be\
            overwritten with background.
        metric_gradient: Write the gradient of the metric to file.
        debug_deriv: Enable periodic checks of derivatives (debug).
        debug_deriv_eps: Epsilon for derivative debugging.
        debug_aff_obj: Plot affine objective in neighborhood of -ia matrix.
        dump_pyramid: Dump the image pyramid at the start of the registration.
        dump_moving: Dump moving image at each iter.
        dump_frequency: Dump frequency.
        dump_prefix: Prefix for dump files (may be a path).
        powell: Use Powell's method instead of LGBFS.
        float_: Use single precision floating point (off by default).
        version: Print version info.
        verbosity: Verbosity level (0: none, 1: default, 2: verbose).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `GreedyOutputs`).
    """
    params = greedy_params(
        dimensions=dimensions,
        input_images=input_images,
        output=output,
        affine=affine,
        brute=brute,
        moments=moments,
        reslice=reslice,
        invert=invert,
        root=root,
        jacobian=jacobian,
        metric_mode=metric_mode,
        defopt=defopt,
        weight=weight,
        metric=metric,
        step_size=step_size,
        iterations=iterations,
        threads=threads,
        fixed_mask=fixed_mask,
        gm_trim=gm_trim,
        moving_mask=moving_mask,
        wncc_mask_dilate=wncc_mask_dilate,
        reference_image=reference_image,
        ref_pad=ref_pad,
        background=background,
        input_transform=input_transform,
        zero_last_dimension=zero_last_dimension,
        time_step_mode=time_step_mode,
        smoothing=smoothing,
        inverse_warp=inverse_warp,
        root_warp=root_warp,
        warp_precision=warp_precision,
        noise=noise,
        exponent=exponent,
        svf_mode=svf_mode,
        svlb=svlb,
        sv_incompr=sv_incompr,
        initial_warp=initial_warp,
        tjr=tjr,
        wr=wr,
        initial_affine=initial_affine,
        ia_identity=ia_identity,
        ia_voxel_grid=ia_voxel_grid,
        ia_image_centers=ia_image_centers,
        ia_image_side=ia_image_side,
        ia_moments=ia_moments,
        affine_dof=affine_dof,
        jitter=jitter,
        search=search,
        det=det,
        cov_id=cov_id,
        fixed_reslicing_image=fixed_reslicing_image,
        reslice_moving_image=reslice_moving_image,
        reslice_surface=reslice_surface,
        interpolation=interpolation,
        reslice_background=reslice_background,
        reslice_datatype=reslice_datatype,
        reslice_composite=reslice_composite,
        reslice_jacobian=reslice_jacobian,
        reslice_simplex_jacobian=reslice_simplex_jacobian,
        reslice_mask=reslice_mask,
        metric_gradient=metric_gradient,
        debug_deriv=debug_deriv,
        debug_deriv_eps=debug_deriv_eps,
        debug_aff_obj=debug_aff_obj,
        dump_pyramid=dump_pyramid,
        dump_moving=dump_moving,
        dump_frequency=dump_frequency,
        dump_prefix=dump_prefix,
        powell=powell,
        float_=float_,
        version=version,
        verbosity=verbosity,
    )
    return greedy_execute(params, runner)


__all__ = [
    "GREEDY_METADATA",
    "GreedyInputImagesParamsDict",
    "GreedyInputImagesParamsDictTagged",
    "GreedyInvertOutputs",
    "GreedyInvertParamsDict",
    "GreedyInvertParamsDictTagged",
    "GreedyJacobianOutputs",
    "GreedyJacobianParamsDict",
    "GreedyJacobianParamsDictTagged",
    "GreedyLabelParamsDict",
    "GreedyLabelParamsDictTagged",
    "GreedyLinearParamsDict",
    "GreedyLinearParamsDictTagged",
    "GreedyMetricParamsDict",
    "GreedyMetricParamsDictTagged",
    "GreedyNnParamsDict",
    "GreedyNnParamsDictTagged",
    "GreedyOutputs",
    "GreedyParamsDict",
    "GreedyParamsDictTagged",
    "GreedyResliceMovingImageOutputs",
    "GreedyResliceMovingImageParamsDict",
    "GreedyResliceMovingImageParamsDictTagged",
    "GreedyResliceSimplexJacobianOutputs",
    "GreedyResliceSimplexJacobianParamsDict",
    "GreedyResliceSimplexJacobianParamsDictTagged",
    "GreedyResliceSurfaceOutputs",
    "GreedyResliceSurfaceParamsDict",
    "GreedyResliceSurfaceParamsDictTagged",
    "GreedyRootOutputs",
    "GreedyRootParamsDict",
    "GreedyRootParamsDictTagged",
    "GreedySearchParamsDict",
    "GreedySearchParamsDictTagged",
    "GreedyTjrParamsDict",
    "GreedyTjrParamsDictTagged",
    "greedy_",
    "greedy_execute",
    "greedy_input_images",
    "greedy_invert",
    "greedy_jacobian",
    "greedy_label",
    "greedy_linear",
    "greedy_metric",
    "greedy_nn",
    "greedy_params",
    "greedy_reslice_moving_image",
    "greedy_reslice_simplex_jacobian",
    "greedy_reslice_surface",
    "greedy_root",
    "greedy_search",
    "greedy_tjr",
]
