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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__FIX_FSSPHERE_METADATA = Metadata(
    id="d809b1d459bb69ca3f96b857c3d048611b3b21a7.boutiques",
    name="@fix_FSsphere",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VFixFssphereOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__fix_fssphere(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    corrected_surface: OutputPathType
    """Corrected surface"""


def v__fix_fssphere(
    runner: Runner | None = None,
) -> VFixFssphereOutputs:
    """
    Tool for fixing errors in FreeSurfer spherical surfaces.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/@fix_FSsphere.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VFixFssphereOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__FIX_FSSPHERE_METADATA)
    cargs = []
    cargs.append("@fix_FSsphere")
    cargs.append("<-spec")
    cargs.append("SPEC>")
    cargs.append("<-sphere")
    cargs.append("SPHERE.asc>")
    cargs.append("[-niter")
    cargs.append("NITER]")
    cargs.append("[-lim")
    cargs.append("LIM]")
    cargs.append("[-keep_temp]")
    cargs.append("[-project_first]")
    ret = VFixFssphereOutputs(
        root=execution.output_file("."),
        corrected_surface=execution.output_file("[SPHERE]_fxd.asc"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VFixFssphereOutputs",
    "V__FIX_FSSPHERE_METADATA",
    "v__fix_fssphere",
]
