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

import typing
import pathlib
from styxdefs import *
import dataclasses

PRINT_UNIQUE_LABELS_CSH_METADATA = Metadata(
    id="e9fb80f03f3d4d6c2fbe65561d9c32f6e16bc580.boutiques",
    name="print_unique_labels.csh",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class PrintUniqueLabelsCshOutputs(typing.NamedTuple):
    """
    Output object returned when calling `print_unique_labels_csh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    results_file: OutputPathType
    """Output file with the list of unique labels"""


def print_unique_labels_csh(
    label_volume: InputPathType,
    list_only: bool = False,
    runner: Runner | None = None,
) -> PrintUniqueLabelsCshOutputs:
    """
    Prints the list of unique labels (with structure name) in the input volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        label_volume: Label volume to be analyzed.
        list_only: Only list the labels.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `PrintUniqueLabelsCshOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(PRINT_UNIQUE_LABELS_CSH_METADATA)
    cargs = []
    cargs.append("print_unique_labels.csh")
    cargs.extend([
        "--vol",
        execution.input_file(label_volume)
    ])
    if list_only:
        cargs.append("--list")
    ret = PrintUniqueLabelsCshOutputs(
        root=execution.output_file("."),
        results_file=execution.output_file("[OUTPUT_FILE]"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "PRINT_UNIQUE_LABELS_CSH_METADATA",
    "PrintUniqueLabelsCshOutputs",
    "print_unique_labels_csh",
]
