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

import typing
import pathlib
from styxdefs import *
import dataclasses

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


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


def volume_label_export_table(
    label_in: InputPathType,
    map_: str,
    table_out: str,
    runner: Runner | None = None,
) -> VolumeLabelExportTableOutputs:
    """
    Export label table from volume as text.
    
    Takes the label table from the volume label map, and writes it to a text
    format matching what is expected by -volume-label-import.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        label_in: the input volume label file.
        map_: the number or name of the label map to use.
        table_out: output - the output text file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumeLabelExportTableOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(VOLUME_LABEL_EXPORT_TABLE_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-volume-label-export-table")
    cargs.append(execution.input_file(label_in))
    cargs.append(map_)
    cargs.append(table_out)
    ret = VolumeLabelExportTableOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VOLUME_LABEL_EXPORT_TABLE_METADATA",
    "VolumeLabelExportTableOutputs",
    "volume_label_export_table",
]
