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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_NORMALITY_TEST_METADATA = Metadata(
    id="0c4fc6300ae871742266f64fa61a03d97788ba70.boutiques",
    name="3dNormalityTest",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dNormalityTestOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_normality_test(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_dataset: OutputPathType
    """Output dataset with results"""


def v_3d_normality_test(
    input_: InputPathType,
    prefix: str,
    noexp: bool = False,
    pval: bool = False,
    runner: Runner | None = None,
) -> V3dNormalityTestOutputs:
    """
    This program tests the input values at each voxel for normality using the
    Anderson-Darling method.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dNormalityTest.html
    
    Args:
        input_: Specifies the input dataset.
        prefix: Specifies the name for the output dataset.
        noexp: Do not convert the A-D statistic to an exponentially distributed\
            value.
        pval: Output the results as a pure (estimated) p-value.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dNormalityTestOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_NORMALITY_TEST_METADATA)
    cargs = []
    cargs.append("3dNormalityTest")
    cargs.append(execution.input_file(input_))
    cargs.append("-prefix")
    cargs.extend([
        "-prefix",
        prefix
    ])
    if noexp:
        cargs.append("-noexp")
    if pval:
        cargs.append("-pval")
    ret = V3dNormalityTestOutputs(
        root=execution.output_file("."),
        output_dataset=execution.output_file(prefix + "+orig.*"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dNormalityTestOutputs",
    "V_3D_NORMALITY_TEST_METADATA",
    "v_3d_normality_test",
]
