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

import typing
import pathlib
from styxdefs import *
import dataclasses

BORDER_TO_ROIS_METADATA = Metadata(
    id="53ffc190f09f435ce8a8a69ab0341699da3030a0.boutiques",
    name="border-to-rois",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def border_to_rois(
    surface: InputPathType,
    border_file: InputPathType,
    metric_out: str,
    opt_border_name: str | None = None,
    opt_inverse: bool = False,
    opt_include_border: bool = False,
    runner: Runner | None = None,
) -> BorderToRoisOutputs:
    """
    Make metric rois from borders.
    
    By default, draws ROIs inside all borders in the border file, as separate
    metric columns.
    
    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.
        opt_inverse: use inverse selection (outside border).
        opt_include_border: include vertices the border is closest to.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `BorderToRoisOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(BORDER_TO_ROIS_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-border-to-rois")
    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
        ])
    if opt_inverse:
        cargs.append("-inverse")
    if opt_include_border:
        cargs.append("-include-border")
    ret = BorderToRoisOutputs(
        root=execution.output_file("."),
        metric_out=execution.output_file(metric_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "BORDER_TO_ROIS_METADATA",
    "BorderToRoisOutputs",
    "border_to_rois",
]
