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

import typing
import pathlib
from styxdefs import *
import dataclasses

ISOLATE_LABELS_CSH_METADATA = Metadata(
    id="38dc57e5ac2ab0f7a3569ce5a6d3b6708f167dad.boutiques",
    name="isolate_labels.csh",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class IsolateLabelsCshOutputs(typing.NamedTuple):
    """
    Output object returned when calling `isolate_labels_csh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def isolate_labels_csh(
    label_volume: InputPathType,
    output_prefix: str,
    lowercase_label_option: str | None = None,
    version: bool = False,
    keepval: bool = False,
    help_: bool = False,
    runner: Runner | None = None,
) -> IsolateLabelsCshOutputs:
    """
    Tool to separate out a particular or all labels into individual binary files for
    subsequent shape analysis.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        label_volume: Label volume to be analyzed.
        output_prefix: Prefix of binary label file(s).
        lowercase_label_option: The particular label to be analyzed; default is\
            all labels.
        version: Print version and exit.
        keepval: Keeps original label values.
        help_: Print help and exit.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `IsolateLabelsCshOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ISOLATE_LABELS_CSH_METADATA)
    cargs = []
    cargs.append("isolate_labels")
    cargs.extend([
        "--vol",
        execution.input_file(label_volume)
    ])
    cargs.extend([
        "--outprefix",
        output_prefix
    ])
    if lowercase_label_option is not None:
        cargs.extend([
            "--l",
            lowercase_label_option
        ])
    if version:
        cargs.append("--version")
    if keepval:
        cargs.append("--keepval")
    if help_:
        cargs.append("--help")
    ret = IsolateLabelsCshOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ISOLATE_LABELS_CSH_METADATA",
    "IsolateLabelsCshOutputs",
    "isolate_labels_csh",
]
