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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_MEMA_METADATA = Metadata(
    id="3e49aad2d71d54e4f942b7cc6311a0fe4225ef3f.boutiques",
    name="3dMEMA",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dMemaOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_mema(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Output file from the analysis"""


def v_3d_mema(
    runner: Runner | None = None,
) -> V3dMemaOutputs:
    """
    3dMEMA is a program for performing Mixed Effects Meta Analysis at group level
    that models both within- and across-subjects variability.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dMemaOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_MEMA_METADATA)
    cargs = []
    cargs.append("3dMEMA")
    cargs.append("[OPTIONS]")
    ret = V3dMemaOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file("[PREFIX].nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dMemaOutputs",
    "V_3D_MEMA_METADATA",
    "v_3d_mema",
]
