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

import typing
import pathlib
from styxdefs import *
import dataclasses

BORDER_TO_VERTICES_METADATA = Metadata(
    id="e79a75a02c66aa23aaa2fd35713b5557b9d4e7e5.boutiques",
    name="border-to-vertices",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def border_to_vertices(
    surface: InputPathType,
    border_file: InputPathType,
    metric_out: str,
    opt_border_name: str | None = None,
    runner: Runner | None = None,
) -> BorderToVerticesOutputs:
    """
    Draw borders as vertices in a metric file.
    
    Outputs a metric with 1s on vertices that follow a border, and 0s elsewhere.
    By default, a separate metric column is created for each border.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        surface: the surface the borders are drawn on.
        border_file: the border file.
        metric_out: the output metric file.
        opt_border_name: create ROI for only one border: the name of the border.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `BorderToVerticesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(BORDER_TO_VERTICES_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-border-to-vertices")
    cargs.append(execution.input_file(surface))
    cargs.append(execution.input_file(border_file))
    cargs.append(metric_out)
    if opt_border_name is not None:
        cargs.extend([
            "-border",
            opt_border_name
        ])
    ret = BorderToVerticesOutputs(
        root=execution.output_file("."),
        metric_out=execution.output_file(metric_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "BORDER_TO_VERTICES_METADATA",
    "BorderToVerticesOutputs",
    "border_to_vertices",
]
