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

import typing
import pathlib
from styxdefs import *
import dataclasses

MAKE_AVERAGE_SUBCORT_METADATA = Metadata(
    id="0c9ffded4567106d920f42e12c804ae17630eddc.boutiques",
    name="make_average_subcort",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MakeAverageSubcortOutputs(typing.NamedTuple):
    """
    Output object returned when calling `make_average_subcort(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_mask_file: OutputPathType
    """Final average subcortical mask in fsaverage/mni305 space"""


def make_average_subcort(
    subjects: list[str],
    output_volume: str,
    runner: Runner | None = None,
) -> MakeAverageSubcortOutputs:
    """
    This creates an average subcortical mask for the given input subjects, intended
    for use in subcortical analysis in FSFAST to exclude cortical voxels.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subjects: List of subject identifiers.
        output_volume: Output volume file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MakeAverageSubcortOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MAKE_AVERAGE_SUBCORT_METADATA)
    cargs = []
    cargs.append("make_average_subcort")
    cargs.extend(subjects)
    cargs.extend([
        "--o",
        output_volume
    ])
    ret = MakeAverageSubcortOutputs(
        root=execution.output_file("."),
        output_mask_file=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MAKE_AVERAGE_SUBCORT_METADATA",
    "MakeAverageSubcortOutputs",
    "make_average_subcort",
]
