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

import typing
import pathlib
from styxdefs import *
import dataclasses

SPLINE3_TEST_METADATA = Metadata(
    id="329f87f17c7d7e02a8b2c078f5a794aee33adae2.boutiques",
    name="Spline3_test",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Spline3TestOutputs(typing.NamedTuple):
    """
    Output object returned when calling `spline3_test(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_ynew: OutputPathType
    """Interpolated y values at new x positions."""
    output_ynewarr: OutputPathType
    """Array format of interpolated y values at new x positions."""


def spline3_test(
    x_values: list[float],
    y_values: list[float],
    x_new_values: list[float],
    runner: Runner | None = None,
) -> Spline3TestOutputs:
    """
    A tool for cubic spline interpolation.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        x_values: Original x values for interpolation.
        y_values: Original y values corresponding to x values.
        x_new_values: New x values where interpolation is evaluated.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Spline3TestOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SPLINE3_TEST_METADATA)
    cargs = []
    cargs.append("Spline3_test")
    cargs.extend(map(str, x_values))
    cargs.extend(map(str, y_values))
    cargs.extend(map(str, x_new_values))
    ret = Spline3TestOutputs(
        root=execution.output_file("."),
        output_ynew=execution.output_file("Ynew.txt"),
        output_ynewarr=execution.output_file("Ynewarr.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SPLINE3_TEST_METADATA",
    "Spline3TestOutputs",
    "spline3_test",
]
