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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL_EXPORT_TABLE_METADATA = Metadata(
    id="e6ffb015df82a0d94657f22347b6a146708f08dc.boutiques",
    name="label-export-table",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def label_export_table(
    label_in: InputPathType,
    table_out: str,
    runner: Runner | None = None,
) -> LabelExportTableOutputs:
    """
    Export label table from gifti as text.
    
    Takes the label table from the gifti label file, and writes it to a text
    format matching what is expected by -metric-label-import.
    
    Author: Washington University School of Medicin
    
    Args:
        label_in: the input label file.
        table_out: output - the output text file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LabelExportTableOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL_EXPORT_TABLE_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-label-export-table")
    cargs.append(execution.input_file(label_in))
    cargs.append(table_out)
    ret = LabelExportTableOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL_EXPORT_TABLE_METADATA",
    "LabelExportTableOutputs",
    "label_export_table",
]
