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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_AVERAGE_CURVATURE_METADATA = Metadata(
    id="e0e2f0072de1c47b7c82a45931a68142836e7e75.boutiques",
    name="mris_average_curvature",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_average_curvature(
    input_curvature_file: InputPathType,
    hemi: str,
    surface: str,
    subjects: list[str],
    output_curvature_file: str,
    summary_stats_flag: bool = False,
    output_surface_flag: bool = False,
    runner: Runner | None = None,
) -> MrisAverageCurvatureOutputs:
    """
    This tool averages curvature data across multiple subjects and generates an
    output curvature file painted onto the last subject specified. It can also
    generate summary statistics if requested.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_curvature_file: The input curvature file.
        hemi: Specifies the hemisphere (e.g., lh or rh).
        surface: Specifies the surface.
        subjects: The list of subjects. The output curvature file will be\
            painted onto the last subject specified.
        output_curvature_file: The output curvature file.
        summary_stats_flag: Generate summary statistics and write them into\
            specified directory.
        output_surface_flag: Override the last subject as the output surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisAverageCurvatureOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_AVERAGE_CURVATURE_METADATA)
    cargs = []
    cargs.append("mris_average_curvature")
    cargs.append(execution.input_file(input_curvature_file))
    cargs.append(hemi)
    cargs.append(surface)
    cargs.extend(subjects)
    cargs.append(output_curvature_file)
    if summary_stats_flag:
        cargs.append("-s")
    if output_surface_flag:
        cargs.append("-o")
    ret = MrisAverageCurvatureOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_AVERAGE_CURVATURE_METADATA",
    "MrisAverageCurvatureOutputs",
    "mris_average_curvature",
]
