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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_LABEL_HISTO_METADATA = Metadata(
    id="279e3275146be4635a5b307d29d8143bca5b3d20.boutiques",
    name="mri_label_histo",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriLabelHistoOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_label_histo(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    histogram_output: OutputPathType
    """Histogram of voxel values for the specified label."""


def mri_label_histo(
    t1_volume: InputPathType,
    labeled_volume: InputPathType,
    label: float,
    output: str,
    runner: Runner | None = None,
) -> MriLabelHistoOutputs:
    """
    Tool for creating a histogram of voxel values within a specified label.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        t1_volume: Input T1-weighted anatomical volume.
        labeled_volume: Input volume with labeled regions.
        label: Label of the region of interest.
        output: Output file for histogram.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriLabelHistoOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_LABEL_HISTO_METADATA)
    cargs = []
    cargs.append("mri_label_histo")
    cargs.append(execution.input_file(t1_volume))
    cargs.append(execution.input_file(labeled_volume))
    cargs.append(str(label))
    cargs.append(output)
    ret = MriLabelHistoOutputs(
        root=execution.output_file("."),
        histogram_output=execution.output_file(output),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_LABEL_HISTO_METADATA",
    "MriLabelHistoOutputs",
    "mri_label_histo",
]
