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

import typing
import pathlib
from styxdefs import *
import dataclasses

POINTSET2LABEL_METADATA = Metadata(
    id="76bc9f6d69a026b807da7960f3bfd93ec5f85c89.boutiques",
    name="pointset2label",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Pointset2labelOutputs(typing.NamedTuple):
    """
    Output object returned when calling `pointset2label(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_label_volume: OutputPathType
    """Output volume label file with applied labels."""


def pointset2label(
    waypoint_file: InputPathType,
    input_volume: InputPathType,
    label_value: float,
    output_volume: str,
    clear_option: bool = False,
    runner: Runner | None = None,
) -> Pointset2labelOutputs:
    """
    Tool for applying waypoint labels to a volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        waypoint_file: Path to the waypoint file.
        input_volume: Path to the input volume file.
        label_value: Label value to apply at the waypoints.
        output_volume: Path to the output volume label file.
        clear_option: Clear the input volume before processing.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Pointset2labelOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(POINTSET2LABEL_METADATA)
    cargs = []
    cargs.append("pointset2label")
    cargs.append(execution.input_file(waypoint_file))
    cargs.append(execution.input_file(input_volume))
    cargs.append(str(label_value))
    cargs.append(output_volume)
    if clear_option:
        cargs.append("-clear")
    ret = Pointset2labelOutputs(
        root=execution.output_file("."),
        output_label_volume=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "POINTSET2LABEL_METADATA",
    "Pointset2labelOutputs",
    "pointset2label",
]
