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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_LABEL_MODE_METADATA = Metadata(
    id="1fe77c6bd59d224a85a54c2c3c93d4c52345517b.boutiques",
    name="mris_label_mode",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisLabelModeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_label_mode(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def mris_label_mode(
    input_curv_file: InputPathType,
    hemi: str,
    surface: str,
    subject: list[str],
    output_curv_file: str,
    summary_statistics: bool = False,
    statistics_cond: str | None = None,
    output_directory: str | None = None,
    runner: Runner | None = None,
) -> MrisLabelModeOutputs:
    """
    This program will add a template into an average surface.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_curv_file: Input curvature file.
        hemi: Hemisphere.
        surface: Surface name.
        subject: Subject name(s).
        output_curv_file: Output curvature file.
        summary_statistics: Generate summary statistics.
        statistics_cond: Condition number for summary statistics.
        output_directory: Override the last subject as the output surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisLabelModeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_LABEL_MODE_METADATA)
    cargs = []
    cargs.append("mris_label_mode")
    cargs.append(execution.input_file(input_curv_file))
    cargs.append(hemi)
    cargs.append(surface)
    cargs.extend(subject)
    cargs.append(output_curv_file)
    if summary_statistics:
        cargs.append("-s")
    if statistics_cond is not None:
        cargs.append(statistics_cond)
    if output_directory is not None:
        cargs.extend([
            "-o",
            output_directory
        ])
    ret = MrisLabelModeOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_LABEL_MODE_METADATA",
    "MrisLabelModeOutputs",
    "mris_label_mode",
]
