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

import typing
import pathlib
from styxdefs import *
import dataclasses

METRIC_ROIS_TO_BORDER_METADATA = Metadata(
    id="7055195b90d96406ade3173df1aa38a66c4c45c1.boutiques",
    name="metric-rois-to-border",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


class MetricRoisToBorderOutputs(typing.NamedTuple):
    """
    Output object returned when calling `metric_rois_to_border(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    border_out: OutputPathType
    """the output border file"""


def metric_rois_to_border(
    surface: InputPathType,
    metric: InputPathType,
    class_name: str,
    border_out: str,
    opt_placement_fraction: float | None = None,
    opt_column_column: str | None = None,
    runner: Runner | None = None,
) -> MetricRoisToBorderOutputs:
    """
    Draw borders around metric rois.
    
    For each ROI column, finds all edges on the mesh that cross the boundary of
    the ROI, and draws borders through them. By default, this is done on all
    columns in the input file, using the map name as the name for the border.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        surface: the surface to use for neighbor information.
        metric: the input metric containing ROIs.
        class_name: the name to use for the class of the output borders.
        border_out: the output border file.
        opt_placement_fraction: set how far along the edge border points are\
            drawn: fraction along edge from inside vertex (default 0.33).
        opt_column_column: select a single column: the column number or name.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MetricRoisToBorderOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(METRIC_ROIS_TO_BORDER_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-metric-rois-to-border")
    cargs.append(execution.input_file(surface))
    cargs.append(execution.input_file(metric))
    cargs.append(class_name)
    cargs.append(border_out)
    if opt_placement_fraction is not None:
        cargs.extend([
            "-placement",
            str(opt_placement_fraction)
        ])
    if opt_column_column is not None:
        cargs.extend([
            "-column",
            opt_column_column
        ])
    ret = MetricRoisToBorderOutputs(
        root=execution.output_file("."),
        border_out=execution.output_file(border_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "METRIC_ROIS_TO_BORDER_METADATA",
    "MetricRoisToBorderOutputs",
    "metric_rois_to_border",
]
