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

import typing
import pathlib
from styxdefs import *
import dataclasses

SURF_INFO_METADATA = Metadata(
    id="98adb2ab56264228c422fbe7734ffc0681c92698.boutiques",
    name="SurfInfo",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class SurfInfoOutputs(typing.NamedTuple):
    """
    Output object returned when calling `surf_info(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    metrics_output: OutputPathType
    """Output file containing calculated surface metrics."""


def surf_info(
    surface: InputPathType,
    com: bool = False,
    debug_level: float | None = None,
    detail_level: float | None = None,
    quiet: bool = False,
    separator: str | None = None,
    input_surface: str | None = None,
    surface_state: str | None = None,
    surface_volume: InputPathType | None = None,
    spec_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> SurfInfoOutputs:
    """
    Tool to gather information about surface files.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/SurfInfo.html
    
    Args:
        surface: Input surface file.
        com: Output the center of mass.
        debug_level: Debugging level (2 turns LocalHead ON).
        detail_level: Calculate surface metrics. 1=yes, 0=no.
        quiet: Do not include the name of the parameter in output.
        separator: Use string SEP to separate parameter values. Default is ' ;\
            '.
        input_surface: Specify the input surface type and file.
        surface_state: Specify surface type, state, and name.
        surface_volume: Specify a surface volume file.
        spec_file: Specify a surface specification (spec) file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SurfInfoOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SURF_INFO_METADATA)
    cargs = []
    cargs.append("SurfInfo")
    cargs.append("[options]")
    cargs.append(execution.input_file(surface))
    if com:
        cargs.append("-COM")
    if debug_level is not None:
        cargs.extend([
            "-debug",
            str(debug_level)
        ])
    if detail_level is not None:
        cargs.extend([
            "-detail",
            str(detail_level)
        ])
    if quiet:
        cargs.append("-quiet")
    if separator is not None:
        cargs.extend([
            "-sep",
            separator
        ])
    if input_surface is not None:
        cargs.extend([
            "-i_TYPE",
            input_surface
        ])
    if surface_state is not None:
        cargs.extend([
            "-tsn",
            surface_state
        ])
    if surface_volume is not None:
        cargs.extend([
            "-sv",
            execution.input_file(surface_volume)
        ])
    if spec_file is not None:
        cargs.extend([
            "-spec",
            execution.input_file(spec_file)
        ])
    ret = SurfInfoOutputs(
        root=execution.output_file("."),
        metrics_output=execution.output_file(pathlib.Path(surface).name + "_metrics.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SURF_INFO_METADATA",
    "SurfInfoOutputs",
    "surf_info",
]
