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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_EXTRACT_MAIN_COMPONENT_METADATA = Metadata(
    id="3c629f67071bd64777c7e0eb6653d23ab4e436c0.boutiques",
    name="mris_extract_main_component",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisExtractMainComponentOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_extract_main_component(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_surface_file: OutputPathType
    """Extracted main component of the input surface"""


def mris_extract_main_component(
    input_surface: InputPathType,
    output_surface: str,
    runner: Runner | None = None,
) -> MrisExtractMainComponentOutputs:
    """
    Tool for extracting the main component from a surface input.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file (e.g. lh.white).
        output_surface: Output surface file (e.g. lh.white.main).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisExtractMainComponentOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_EXTRACT_MAIN_COMPONENT_METADATA)
    cargs = []
    cargs.append("mris_extract_main_component")
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_surface)
    ret = MrisExtractMainComponentOutputs(
        root=execution.output_file("."),
        output_surface_file=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_EXTRACT_MAIN_COMPONENT_METADATA",
    "MrisExtractMainComponentOutputs",
    "mris_extract_main_component",
]
