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

import typing
import pathlib
from styxdefs import *
import dataclasses

LABEL_SUBJECT_FLASH_METADATA = Metadata(
    id="6437bdd8443156c21638b016c6209131b9efc309.boutiques",
    name="label_subject_flash",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class LabelSubjectFlashOutputs(typing.NamedTuple):
    """
    Output object returned when calling `label_subject_flash(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    aseg_outfile: OutputPathType
    """Automatic segmentation (aseg) output file"""


def label_subject_flash(
    tissue_params: InputPathType,
    norm_volume: InputPathType,
    transform_file: InputPathType,
    classifier_array: InputPathType,
    aseg_output: str,
    runner: Runner | None = None,
) -> LabelSubjectFlashOutputs:
    """
    A tool for labeling brain structures in an MRI dataset using FLASH sequences and
    the FreeSurfer software.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        tissue_params: Path to the tissue parameter file for FLASH sequences.
        norm_volume: Path to the normalized T1 volume.
        transform_file: Talairach linear transform file.
        classifier_array: Path to the classifier array in GCA format.
        aseg_output: Output path for the automatic segmentation (aseg) file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LabelSubjectFlashOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LABEL_SUBJECT_FLASH_METADATA)
    cargs = []
    cargs.append("mri_ca_label")
    cargs.extend([
        "-flash",
        execution.input_file(tissue_params)
    ])
    cargs.append(execution.input_file(norm_volume))
    cargs.append(execution.input_file(transform_file))
    cargs.append(execution.input_file(classifier_array))
    cargs.append(aseg_output)
    ret = LabelSubjectFlashOutputs(
        root=execution.output_file("."),
        aseg_outfile=execution.output_file(aseg_output),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LABEL_SUBJECT_FLASH_METADATA",
    "LabelSubjectFlashOutputs",
    "label_subject_flash",
]
