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

import typing
import pathlib
from styxdefs import *
import dataclasses

SURF_TO_SURF_METADATA = Metadata(
    id="a2c971cd7bb0ee914e8be7cd7e5159482c16cc13.boutiques",
    name="SurfToSurf",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class SurfToSurfOutputs(typing.NamedTuple):
    """
    Output object returned when calling `surf_to_surf(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType | None
    """Output file in 1D format"""


def surf_to_surf(
    input_surface_1: InputPathType,
    input_surface_2: InputPathType,
    surface_volume: InputPathType | None = None,
    prefix: str | None = None,
    output_params: str | None = None,
    node_indices: InputPathType | None = None,
    proj_dir: InputPathType | None = None,
    data: InputPathType | None = None,
    node_debug: float | None = None,
    debug_level: float | None = None,
    make_consistent: bool = False,
    dset: InputPathType | None = None,
    mapfile: InputPathType | None = None,
    runner: Runner | None = None,
) -> SurfToSurfOutputs:
    """
    Interpolate data from one surface to another.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_surface_1: First input surface file (S1).
        input_surface_2: Second input surface file (S2).
        surface_volume: Specify the surface volume (SV1).
        prefix: Specify prefix for the output file.
        output_params: List of mapping parameters to include in output.
        node_indices: 1D file containing node indices of S1 to consider.
        proj_dir: 1D file containing projection directions.
        data: 1D file containing data to be interpolated.
        node_debug: Node index for debugging purposes.
        debug_level: Debugging level.
        make_consistent: Force a consistency check and correct triangle\
            orientation.
        dset: Dataset file for data interpolation; mutually exclusive with\
            -data.
        mapfile: File containing mapping parameters between surfaces S2 and S1.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SurfToSurfOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SURF_TO_SURF_METADATA)
    cargs = []
    cargs.append("SurfToSurf")
    cargs.append(execution.input_file(input_surface_1))
    cargs.append(execution.input_file(input_surface_2))
    if surface_volume is not None:
        cargs.extend([
            "-sv",
            execution.input_file(surface_volume)
        ])
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if output_params is not None:
        cargs.extend([
            "-output_params",
            output_params
        ])
    if node_indices is not None:
        cargs.extend([
            "-node_indices",
            execution.input_file(node_indices)
        ])
    if proj_dir is not None:
        cargs.extend([
            "-proj_dir",
            execution.input_file(proj_dir)
        ])
    if data is not None:
        cargs.extend([
            "-data",
            execution.input_file(data)
        ])
    if node_debug is not None:
        cargs.extend([
            "-node_debug",
            str(node_debug)
        ])
    if debug_level is not None:
        cargs.extend([
            "-debug",
            str(debug_level)
        ])
    if make_consistent:
        cargs.append("-make_consistent")
    if dset is not None:
        cargs.extend([
            "-dset",
            execution.input_file(dset)
        ])
    if mapfile is not None:
        cargs.extend([
            "-mapfile",
            execution.input_file(mapfile)
        ])
    ret = SurfToSurfOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(prefix + ".1D") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SURF_TO_SURF_METADATA",
    "SurfToSurfOutputs",
    "surf_to_surf",
]
