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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL2FLAT_METADATA = Metadata(
    id="4324c6b767a12f1782bca11055508c5f21fddd7d.boutiques",
    name="label2flat",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Label2flatOutputs(typing.NamedTuple):
    """
    Output object returned when calling `label2flat(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    result_file: OutputPathType
    """The processed output file generated by label2flat."""


def label2flat(
    subject_name: str,
    label_file: InputPathType,
    patch_file: InputPathType,
    output_file: str,
    runner: Runner | None = None,
) -> Label2flatOutputs:
    """
    A tool used in FreeSurfer to process labeling and patch files.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_name: The name of the subject.
        label_file: The label file path.
        patch_file: The patch file path.
        output_file: The output file path.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Label2flatOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL2FLAT_METADATA)
    cargs = []
    cargs.append("label2flat")
    cargs.append(subject_name)
    cargs.append(execution.input_file(label_file))
    cargs.append(execution.input_file(patch_file))
    cargs.append(output_file)
    ret = Label2flatOutputs(
        root=execution.output_file("."),
        result_file=execution.output_file(output_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL2FLAT_METADATA",
    "Label2flatOutputs",
    "label2flat",
]
