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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL_SUBJECT_MIXED_METADATA = Metadata(
    id="c89d204a94ff9a438c87e6af7616b21249be8dd9.boutiques",
    name="label_subject_mixed",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class LabelSubjectMixedOutputs(typing.NamedTuple):
    """
    Output object returned when calling `label_subject_mixed(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_aseg: OutputPathType
    """Labeled segmentation output"""


def label_subject_mixed(
    brain_mask: InputPathType,
    norm_volume: InputPathType,
    transform: InputPathType,
    gca_file: InputPathType,
    aseg_output: str,
    runner: Runner | None = None,
) -> LabelSubjectMixedOutputs:
    """
    Automatic labeling of brain regions using a Gaussian classifier array.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        brain_mask: Brain mask to be used for final labeling.
        norm_volume: Normalized volume.
        transform: Transform file in LTA format.
        gca_file: Gaussian classifier array (GCA) file.
        aseg_output: Output aseg file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LabelSubjectMixedOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL_SUBJECT_MIXED_METADATA)
    cargs = []
    cargs.append("mri_ca_label")
    cargs.extend([
        "-mask",
        execution.input_file(brain_mask)
    ])
    cargs.append(execution.input_file(norm_volume))
    cargs.append(execution.input_file(transform))
    cargs.append(execution.input_file(gca_file))
    cargs.append(aseg_output)
    ret = LabelSubjectMixedOutputs(
        root=execution.output_file("."),
        output_aseg=execution.output_file(aseg_output),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL_SUBJECT_MIXED_METADATA",
    "LabelSubjectMixedOutputs",
    "label_subject_mixed",
]
