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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIRST_UTILS_METADATA = Metadata(
    id="ddadf7ecb37493fd4432721f51af29a24ce03807.boutiques",
    name="first_utils",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


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


def first_utils(
    input_file: InputPathType,
    output_name: str,
    runner: Runner | None = None,
) -> FirstUtilsOutputs:
    """
    Utilities for handling FIRST's input and output files.
    
    Author: University of Oxford (Brian Patenaude)
    
    Args:
        input_file: Filename of input image/mesh/bvars.
        output_name: Output name.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FirstUtilsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIRST_UTILS_METADATA)
    cargs = []
    cargs.append("first_utils")
    cargs.append("[OPTIONAL_ARGS]")
    cargs.append("-i")
    cargs.extend([
        "-i",
        execution.input_file(input_file)
    ])
    cargs.append("-o")
    cargs.extend([
        "-o",
        output_name
    ])
    ret = FirstUtilsOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIRST_UTILS_METADATA",
    "FirstUtilsOutputs",
    "first_utils",
]
