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

import typing
import pathlib
from styxdefs import *
import dataclasses

REG_F3D_METADATA = Metadata(
    id="2bb4b67c73d488ef6c20b58357b368c5399e015c.boutiques",
    name="reg_f3d",
    package="niftyreg",
    container_image_tag="vnmd/niftyreg_1.4.0:20220819",
)


class RegF3dOutputs(typing.NamedTuple):
    """
    Output object returned when calling `reg_f3d(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_cpp_file: OutputPathType
    """File containing the output control point grid"""
    output_resampled_image_file: OutputPathType
    """File containing the resampled image"""


def reg_f3d(
    reference_image: InputPathType,
    floating_image: InputPathType,
    runner: Runner | None = None,
) -> RegF3dOutputs:
    """
    Fast Free-Form Deformation algorithm for non-rigid registration based on
    Rueckert's 99 TMI work.
    
    Author: Marc Modat
    
    URL: http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg
    
    Args:
        reference_image: Filename of the reference image.
        floating_image: Filename of the floating image.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `RegF3dOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(REG_F3D_METADATA)
    cargs = []
    cargs.append("reg_f3d")
    cargs.append("-ref")
    cargs.extend([
        "-ref",
        execution.input_file(reference_image)
    ])
    cargs.append("-flo")
    cargs.extend([
        "-flo",
        execution.input_file(floating_image)
    ])
    cargs.append("[OPTIONS]")
    ret = RegF3dOutputs(
        root=execution.output_file("."),
        output_cpp_file=execution.output_file("[OUTPUT_CPP]"),
        output_resampled_image_file=execution.output_file("[OUTPUT_RESAMPLED_IMAGE]"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "REG_F3D_METADATA",
    "RegF3dOutputs",
    "reg_f3d",
]
