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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_GEN_FEATURE_DIST_METADATA = Metadata(
    id="199bdb69edfe9e06ea3902546ede4dde87cb2831.boutiques",
    name="3dGenFeatureDist",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dGenFeatureDistOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_gen_feature_dist(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_hive: OutputPathType | None
    """Histogram volume output"""


def v_3d_gen_feature_dist(
    features_string: str,
    class_string: str,
    prefix: str | None = None,
    overwrite: bool = False,
    debug_level: float | None = None,
    other: bool = False,
    no_other: bool = False,
    show_histograms: str | None = None,
    runner: Runner | None = None,
) -> V3dGenFeatureDistOutputs:
    """
    3dGenFeatureDist produces histogram volume (hives) from input data.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dGenFeatureDist.html
    
    Args:
        features_string: FEATURES_STRING is a semicolon delimited string of\
            features.
        class_string: CLASS_STRING is a semicolon delimited string of class\
            labels.
        prefix: PREF is the prefix for all output volumes that are not\
            debugging related.
        overwrite: Automatically overwrite existing output.
        debug_level: Debugging level.
        other: Add histograms for an 'OTHER' class that has a uniform pdf.
        no_other: Opposite of -OTHER.
        show_histograms: Show specified histograms and quit.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dGenFeatureDistOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_GEN_FEATURE_DIST_METADATA)
    cargs = []
    cargs.append("3dGenFeatureDist")
    cargs.extend([
        "-features",
        features_string
    ])
    cargs.extend([
        "-classes",
        class_string
    ])
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if overwrite:
        cargs.append("-overwrite")
    if debug_level is not None:
        cargs.extend([
            "-debug",
            str(debug_level)
        ])
    if other:
        cargs.append("-OTHER")
    if no_other:
        cargs.append("-no_OTHER")
    if show_histograms is not None:
        cargs.extend([
            "-ShowTheseHists",
            show_histograms
        ])
    ret = V3dGenFeatureDistOutputs(
        root=execution.output_file("."),
        output_hive=execution.output_file(prefix + "_hive.nii.gz") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dGenFeatureDistOutputs",
    "V_3D_GEN_FEATURE_DIST_METADATA",
    "v_3d_gen_feature_dist",
]
