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

import typing
import pathlib
from styxdefs import *
import dataclasses

SURFACE_VERTEX_AREAS_METADATA = Metadata(
    id="f99539e6c03e9d952d920096d6ea72347bfef0d1.boutiques",
    name="surface-vertex-areas",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def surface_vertex_areas(
    surface: InputPathType,
    metric: str,
    runner: Runner | None = None,
) -> SurfaceVertexAreasOutputs:
    """
    Measure surface area each vertex is responsible for.
    
    Each vertex gets one third of the area of each triangle it is a part of.
    Units are mm^2.
    
    Author: Washington University School of Medicin
    
    Args:
        surface: the surface to measure.
        metric: the output metric.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SurfaceVertexAreasOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SURFACE_VERTEX_AREAS_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-surface-vertex-areas")
    cargs.append(execution.input_file(surface))
    cargs.append(metric)
    ret = SurfaceVertexAreasOutputs(
        root=execution.output_file("."),
        metric=execution.output_file(metric),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SURFACE_VERTEX_AREAS_METADATA",
    "SurfaceVertexAreasOutputs",
    "surface_vertex_areas",
]
