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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSL_LABEL2VOXEL_METADATA = Metadata(
    id="1a0b4441c6daf326201e9ffe4e61b70d47c06809.boutiques",
    name="fsl_label2voxel",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FslLabel2voxelOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fsl_label2voxel(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_voxel_data: OutputPathType
    """Output voxel data based on the specified label value"""


def fsl_label2voxel(
    label_value: float,
    labeled_volume: InputPathType,
    src_volume: InputPathType,
    output_filename: str,
    runner: Runner | None = None,
) -> FslLabel2voxelOutputs:
    """
    Converts labeled volumes to voxels based on specified labels.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        label_value: Label value to convert.
        labeled_volume: Labeled volume file.
        src_volume: Source volume file.
        output_filename: Output filename for voxel data.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FslLabel2voxelOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSL_LABEL2VOXEL_METADATA)
    cargs = []
    cargs.append("fsl_label2voxel")
    cargs.append(str(label_value))
    cargs.append(execution.input_file(labeled_volume))
    cargs.append(execution.input_file(src_volume))
    cargs.append(output_filename)
    ret = FslLabel2voxelOutputs(
        root=execution.output_file("."),
        output_voxel_data=execution.output_file(output_filename),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSL_LABEL2VOXEL_METADATA",
    "FslLabel2voxelOutputs",
    "fsl_label2voxel",
]
