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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_MAKE_FACE_PARCELLATION_METADATA = Metadata(
    id="47813723c3b8dcdc56ee88729e050b27cbb7ae13.boutiques",
    name="mris_make_face_parcellation",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisMakeFaceParcellationOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_make_face_parcellation(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    annot_file: OutputPathType
    """Generated annotation file based on the icosahedral face mapping."""


def mris_make_face_parcellation(
    input_surface: InputPathType,
    ico_file: InputPathType,
    output_annot: str,
    colortable: InputPathType | None = None,
    runner: Runner | None = None,
) -> MrisMakeFaceParcellationOutputs:
    """
    Generates a parcellation based on which icosahedral face each vertex maps to.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file (e.g. lh.sphere or lh.sphere.reg).
        ico_file: Icosahedron file (e.g. ic3.tri).
        output_annot: Output annotation file (e.g. lh.ic3.annot).
        colortable: Color table file (e.g. colortable.txt).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisMakeFaceParcellationOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_MAKE_FACE_PARCELLATION_METADATA)
    cargs = []
    cargs.append("mris_make_face_parcellation")
    cargs.append(execution.input_file(input_surface))
    cargs.append(execution.input_file(ico_file))
    cargs.append(output_annot)
    if colortable is not None:
        cargs.extend([
            "-ctab",
            execution.input_file(colortable)
        ])
    ret = MrisMakeFaceParcellationOutputs(
        root=execution.output_file("."),
        annot_file=execution.output_file(output_annot),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_MAKE_FACE_PARCELLATION_METADATA",
    "MrisMakeFaceParcellationOutputs",
    "mris_make_face_parcellation",
]
