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

import typing
import pathlib
from styxdefs import *
import dataclasses

T4IMG_4DFP_METADATA = Metadata(
    id="57020555f03db47bd822a3164b665430a2020fd9.boutiques",
    name="t4img_4dfp",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class T4img4dfpOutputs(typing.NamedTuple):
    """
    Output object returned when calling `t4img_4dfp(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    transformed_image: OutputPathType | None
    """The transformed output image file in 4dfp format."""


def t4img_4dfp(
    t4file: InputPathType,
    imgfile: InputPathType,
    outfile: str | None = None,
    runner: Runner | None = None,
) -> T4img4dfpOutputs:
    """
    Transforms a 4dfp image using a specified t4 file.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        t4file: Transformation matrix file (t4 file format).
        imgfile: Input image file (4dfp format).
        outfile: Output image file (optional, defaults to <imgfile>t if not\
            provided).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `T4img4dfpOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(T4IMG_4DFP_METADATA)
    cargs = []
    cargs.append("t4img_4dfp")
    cargs.append(execution.input_file(t4file))
    cargs.append(execution.input_file(imgfile))
    if outfile is not None:
        cargs.append(outfile)
    ret = T4img4dfpOutputs(
        root=execution.output_file("."),
        transformed_image=execution.output_file(outfile + ".4dfp.img") if (outfile is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "T4IMG_4DFP_METADATA",
    "T4img4dfpOutputs",
    "t4img_4dfp",
]
