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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL2SURF_METADATA = Metadata(
    id="cd63394affbc5928ed92ba87251a2f8b6f4f20e0.boutiques",
    name="label2surf",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class Label2surfOutputs(typing.NamedTuple):
    """
    Output object returned when calling `label2surf(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    out_surf: OutputPathType
    """Resulting output surface file"""


def label2surf(
    input_surface: InputPathType,
    output_surface: str,
    labels: InputPathType,
    verbose_flag: bool = False,
    help_flag: bool = False,
    runner: Runner | None = None,
) -> Label2surfOutputs:
    """
    Transform a group of labels into a surface.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        input_surface: Input surface file.
        output_surface: Output surface file.
        labels: ASCII list of label files.
        verbose_flag: Switch on diagnostic messages.
        help_flag: Display help message.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Label2surfOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL2SURF_METADATA)
    cargs = []
    cargs.append("label2surf")
    cargs.extend([
        "--surf",
        execution.input_file(input_surface)
    ])
    cargs.extend([
        "--out",
        output_surface
    ])
    cargs.extend([
        "--labels",
        execution.input_file(labels)
    ])
    if verbose_flag:
        cargs.append("--verbose")
    if help_flag:
        cargs.append("--help")
    ret = Label2surfOutputs(
        root=execution.output_file("."),
        out_surf=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL2SURF_METADATA",
    "Label2surfOutputs",
    "label2surf",
]
