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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_LABEL_VALS_METADATA = Metadata(
    id="f676fd9e1e255bdfcf8e5d6db1b8b8906a5d7a0e.boutiques",
    name="mri_label_vals",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mri_label_vals(
    volume: InputPathType,
    label_file: InputPathType,
    cras_flag: bool = False,
    help_flag: bool = False,
    runner: Runner | None = None,
) -> MriLabelValsOutputs:
    """
    Extract values at label coordinates from a volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        volume: Input volume file.
        label_file: Input label file.
        cras_flag: Use this option if the label was created where c_(r,a,s) !=\
            0.
        help_flag: Print help.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriLabelValsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_LABEL_VALS_METADATA)
    cargs = []
    cargs.append("mri_label_vals")
    cargs.append(execution.input_file(volume))
    cargs.append(execution.input_file(label_file))
    if cras_flag:
        cargs.append("-cras")
    if help_flag:
        cargs.append("-u")
    ret = MriLabelValsOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_LABEL_VALS_METADATA",
    "MriLabelValsOutputs",
    "mri_label_vals",
]
