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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_ANNOT_TO_SEGMENTATION_METADATA = Metadata(
    id="a6fe77811c128028277a69a99f1e7f945cb0ac57.boutiques",
    name="mris_annot_to_segmentation",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisAnnotToSegmentationOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_annot_to_segmentation(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_volume_file: OutputPathType
    """Generated segmentation volume."""


def mris_annot_to_segmentation(
    subject_name: str,
    hemi: str,
    surface: str,
    annot_file: InputPathType,
    color_table: InputPathType,
    output_volume: str,
    runner: Runner | None = None,
) -> MrisAnnotToSegmentationOutputs:
    """
    Converts annotation files to segmentation volumes in FreeSurfer.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_name: Subject name.
        hemi: Hemisphere (e.g., lh or rh).
        surface: Surface file.
        annot_file: Annotation file.
        color_table: Color table file.
        output_volume: Output volume file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisAnnotToSegmentationOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_ANNOT_TO_SEGMENTATION_METADATA)
    cargs = []
    cargs.append("mris_annot_to_segmentation")
    cargs.append(subject_name)
    cargs.append(hemi)
    cargs.append(surface)
    cargs.append(execution.input_file(annot_file))
    cargs.append(execution.input_file(color_table))
    cargs.append(output_volume)
    ret = MrisAnnotToSegmentationOutputs(
        root=execution.output_file("."),
        output_volume_file=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_ANNOT_TO_SEGMENTATION_METADATA",
    "MrisAnnotToSegmentationOutputs",
    "mris_annot_to_segmentation",
]
