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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_TOPO_FIXER_METADATA = Metadata(
    id="4b97f9063ba3136c5f175963808d0468021279ab.boutiques",
    name="mris_topo_fixer",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisTopoFixerOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_topo_fixer(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    fixed_surface: OutputPathType
    """Surface file with fixed topology."""


def mris_topo_fixer(
    input_surface: InputPathType,
    output_surface: str,
    runner: Runner | None = None,
) -> MrisTopoFixerOutputs:
    """
    FreeSurfer tool for fixing topological defects in cortical surface meshes.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file that needs topological fixing.
        output_surface: Output surface file with fixed topology.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisTopoFixerOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_TOPO_FIXER_METADATA)
    cargs = []
    cargs.append("mris_topo_fixer")
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_surface)
    ret = MrisTopoFixerOutputs(
        root=execution.output_file("."),
        fixed_surface=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_TOPO_FIXER_METADATA",
    "MrisTopoFixerOutputs",
    "mris_topo_fixer",
]
