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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIND_THE_BIGGEST_METADATA = Metadata(
    id="3dbb5859444668bef5d4d2dc4f26feb48bfc1655.boutiques",
    name="find_the_biggest",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class FindTheBiggestOutputs(typing.NamedTuple):
    """
    Output object returned when calling `find_the_biggest(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Index of the largest volume or surface"""


def find_the_biggest(
    volumes_surfaces: list[InputPathType],
    output_index: str,
    runner: Runner | None = None,
) -> FindTheBiggestOutputs:
    """
    Tool to find the largest volume or surface from a set of inputs.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        volumes_surfaces: List of input volumes or surfaces.
        output_index: Output index of the largest volume or surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FindTheBiggestOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIND_THE_BIGGEST_METADATA)
    cargs = []
    cargs.append("find_the_biggest")
    cargs.extend([execution.input_file(f) for f in volumes_surfaces])
    cargs.append(output_index)
    ret = FindTheBiggestOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(output_index),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIND_THE_BIGGEST_METADATA",
    "FindTheBiggestOutputs",
    "find_the_biggest",
]
