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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL_TO_BORDER_METADATA = Metadata(
    id="6283a756b635b22e20fe2df1e148bdcf0d92d100.boutiques",
    name="label-to-border",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def label_to_border(
    surface: InputPathType,
    label_in: InputPathType,
    border_out: str,
    opt_placement_fraction: float | None = None,
    opt_column_column: str | None = None,
    runner: Runner | None = None,
) -> LabelToBorderOutputs:
    """
    Draw borders around labels.
    
    For each label, finds all edges on the mesh that cross the boundary of the
    label, and draws borders through them. By default, this is done on all
    columns in the input file, using the map name as the class name for the
    border.
    
    Author: Washington University School of Medicin
    
    Args:
        surface: the surface to use for neighbor information.
        label_in: the input label file.
        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 `LabelToBorderOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL_TO_BORDER_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-label-to-border")
    cargs.append(execution.input_file(surface))
    cargs.append(execution.input_file(label_in))
    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 = LabelToBorderOutputs(
        root=execution.output_file("."),
        border_out=execution.output_file(border_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL_TO_BORDER_METADATA",
    "LabelToBorderOutputs",
    "label_to_border",
]
