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

import typing
import pathlib
from styxdefs import *
import dataclasses

IMGREG_4DFP_METADATA = Metadata(
    id="56f755f16ccfb6ca990d0bdefae3bf38a4194227.boutiques",
    name="imgreg_4dfp",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Imgreg4dfpOutputs(typing.NamedTuple):
    """
    Output object returned when calling `imgreg_4dfp(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def imgreg_4dfp(
    target_image: InputPathType,
    source_image: InputPathType,
    t4file: str,
    mode: str,
    target_mask: str = "none",
    source_mask: str = "none",
    runner: Runner | None = None,
) -> Imgreg4dfpOutputs:
    """
    Image registration utility using 4dfp.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        target_image: Target image.
        source_image: Source image.
        t4file: Transformation file.
        mode: Mode of operation.
        target_mask: Target mask.
        source_mask: Source mask.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Imgreg4dfpOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(IMGREG_4DFP_METADATA)
    cargs = []
    cargs.append("imgreg_4dfp")
    cargs.append(execution.input_file(target_image))
    cargs.append(target_mask)
    cargs.append(execution.input_file(source_image))
    cargs.append(source_mask)
    cargs.append(t4file)
    cargs.append(mode)
    ret = Imgreg4dfpOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "IMGREG_4DFP_METADATA",
    "Imgreg4dfpOutputs",
    "imgreg_4dfp",
]
