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

import typing
import pathlib
from styxdefs import *
import dataclasses

SURFACE_CURVATURE_METADATA = Metadata(
    id="2504b15bc1ec1bebe9f157d99ecaf66b1f5987f8.boutiques",
    name="surface-curvature",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


class SurfaceCurvatureOutputs(typing.NamedTuple):
    """
    Output object returned when calling `surface_curvature(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    mean_out: OutputPathType
    """mean curvature metric"""
    gauss_out: OutputPathType
    """gaussian curvature metric"""


def surface_curvature(
    surface: InputPathType,
    mean_out: str,
    gauss_out: str,
    opt_mean: bool = False,
    opt_gauss: bool = False,
    runner: Runner | None = None,
) -> SurfaceCurvatureOutputs:
    """
    Calculate curvature of surface.
    
    Compute the curvature of the surface, using the method from:
    Interactive Texture Mapping by J. Maillot, Yahia, and Verroust, 1993.
    ACM-0-98791-601-8/93/008.
    
    Author: Washington University School of Medicin
    
    Args:
        surface: the surface to compute the curvature of.
        mean_out: mean curvature metric.
        gauss_out: gaussian curvature metric.
        opt_mean: output mean curvature.
        opt_gauss: output gaussian curvature.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SurfaceCurvatureOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SURFACE_CURVATURE_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-surface-curvature")
    cargs.append(execution.input_file(surface))
    if opt_mean:
        cargs.append("-mean")
    cargs.append(mean_out)
    if opt_gauss:
        cargs.append("-gauss")
    cargs.append(gauss_out)
    ret = SurfaceCurvatureOutputs(
        root=execution.output_file("."),
        mean_out=execution.output_file(mean_out),
        gauss_out=execution.output_file(gauss_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SURFACE_CURVATURE_METADATA",
    "SurfaceCurvatureOutputs",
    "surface_curvature",
]
