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

import typing
import pathlib
from styxdefs import *
import dataclasses

GIFTI_ALL_LABELS_TO_ROIS_METADATA = Metadata(
    id="8feb86a09b900110a8e744140ee2ac040e44f3bb.boutiques",
    name="gifti-all-labels-to-rois",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


class GiftiAllLabelsToRoisOutputs(typing.NamedTuple):
    """
    Output object returned when calling `gifti_all_labels_to_rois(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    metric_out: OutputPathType
    """the output metric file"""


def gifti_all_labels_to_rois(
    label_in: InputPathType,
    map_: str,
    metric_out: str,
    runner: Runner | None = None,
) -> GiftiAllLabelsToRoisOutputs:
    """
    Make rois from all labels in a gifti column.
    
    The output metric file has a column for each label in the specified input
    map, other than the ??? label, each of which contains an ROI of all vertices
    that are set to the corresponding label.
    
    Author: Washington University School of Medicin
    
    Args:
        label_in: the input gifti label file.
        map_: the number or name of the label map to use.
        metric_out: the output metric file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `GiftiAllLabelsToRoisOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(GIFTI_ALL_LABELS_TO_ROIS_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-gifti-all-labels-to-rois")
    cargs.append(execution.input_file(label_in))
    cargs.append(map_)
    cargs.append(metric_out)
    ret = GiftiAllLabelsToRoisOutputs(
        root=execution.output_file("."),
        metric_out=execution.output_file(metric_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "GIFTI_ALL_LABELS_TO_ROIS_METADATA",
    "GiftiAllLabelsToRoisOutputs",
    "gifti_all_labels_to_rois",
]
