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

import typing
import pathlib
from styxdefs import *
import dataclasses

QUANTIFY_BRAINSTEM_STRUCTURES_SH_METADATA = Metadata(
    id="bb094a739a47e09361aec760ca2b87105ebeb041.boutiques",
    name="quantifyBrainstemStructures.sh",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class QuantifyBrainstemStructuresShOutputs(typing.NamedTuple):
    """
    Output object returned when calling `quantify_brainstem_structures_sh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    results_file: OutputPathType
    """Output file containing the gathered results."""


def quantify_brainstem_structures_sh(
    output_file: str,
    subjects_directory: str | None = "/usr/local/freesurfer/subjects",
    runner: Runner | None = None,
) -> QuantifyBrainstemStructuresShOutputs:
    """
    A script to gather results from FreeSurfer brainstem processing and write them
    to an output file.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        output_file: The path to the output file where results should be\
            written.
        subjects_directory: The directory containing subject data. Defaults to\
            '/usr/local/freesurfer/subjects' if not provided.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `QuantifyBrainstemStructuresShOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(QUANTIFY_BRAINSTEM_STRUCTURES_SH_METADATA)
    cargs = []
    cargs.append("quantifyBrainstemStructures.sh")
    cargs.append(output_file)
    if subjects_directory is not None:
        cargs.append(subjects_directory)
    ret = QuantifyBrainstemStructuresShOutputs(
        root=execution.output_file("."),
        results_file=execution.output_file(output_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "QUANTIFY_BRAINSTEM_STRUCTURES_SH_METADATA",
    "QuantifyBrainstemStructuresShOutputs",
    "quantify_brainstem_structures_sh",
]
