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

import typing
import pathlib
from styxdefs import *
import dataclasses

IMAVER_METADATA = Metadata(
    id="3251542a62df461a6a7151ca506b64c9358fa1cf.boutiques",
    name="imaver",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class ImaverOutputs(typing.NamedTuple):
    """
    Output object returned when calling `imaver(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    out_ave_output: OutputPathType | None
    """Output image file for averages (optional)"""
    out_sig_output: OutputPathType | None
    """Output image file for standard deviations (optional)"""


def imaver(
    input_images: list[InputPathType],
    out_ave: str | None = None,
    out_sig: str | None = None,
    runner: Runner | None = None,
) -> ImaverOutputs:
    """
    Computes the mean and standard deviation, pixel-by-pixel, of a whole bunch of
    images.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/imaver.html
    
    Args:
        input_images: Input image files for processing.
        out_ave: Output average image file. Use '-' to skip output.
        out_sig: Output standard deviation image file. Use '-' to skip output.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ImaverOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(IMAVER_METADATA)
    cargs = []
    cargs.append("imaver")
    if out_ave is not None:
        cargs.append(out_ave)
    if out_sig is not None:
        cargs.append(out_sig)
    cargs.extend([execution.input_file(f) for f in input_images])
    ret = ImaverOutputs(
        root=execution.output_file("."),
        out_ave_output=execution.output_file(out_ave) if (out_ave is not None) else None,
        out_sig_output=execution.output_file(out_sig) if (out_sig is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "IMAVER_METADATA",
    "ImaverOutputs",
    "imaver",
]
