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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_MORPH_STATS_METADATA = Metadata(
    id="099da71ba5e21f2b547c57eee2eaadeb2784a79c.boutiques",
    name="mris_morph_stats",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisMorphStatsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_morph_stats(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    stats_output: OutputPathType
    """Generated statistics of the surface-based deformation field."""


def mris_morph_stats(
    subject_name: str,
    hemisphere: typing.Literal["lh", "rh"],
    morphed_surface: InputPathType,
    output_name: str,
    runner: Runner | None = None,
) -> MrisMorphStatsOutputs:
    """
    This program generates statistics which characterize a surface-based deformation
    field.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_name: Name of the subject.
        hemisphere: Hemisphere, either 'lh' for left hemisphere or 'rh' for\
            right hemisphere.
        morphed_surface: Morphed surface file.
        output_name: Name of the output to be generated.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisMorphStatsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_MORPH_STATS_METADATA)
    cargs = []
    cargs.append("mris_morph_stats")
    cargs.append(subject_name)
    cargs.append(hemisphere)
    cargs.append(execution.input_file(morphed_surface))
    cargs.append(output_name)
    ret = MrisMorphStatsOutputs(
        root=execution.output_file("."),
        stats_output=execution.output_file(output_name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_MORPH_STATS_METADATA",
    "MrisMorphStatsOutputs",
    "mris_morph_stats",
]
