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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_SETUP_GROUP_IN_CORR_METADATA = Metadata(
    id="02e5c2cd54cdb6f0011268c1d7356b9a0a55be7c.boutiques",
    name="3dSetupGroupInCorr",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dSetupGroupInCorrOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_setup_group_in_corr(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    niml_file: OutputPathType
    """Text file containing the header information describing the data file."""
    data_file: OutputPathType
    """Data file containing all the time series from all the datasets."""


def v_3d_setup_group_in_corr(
    datasets: list[InputPathType],
    runner: Runner | None = None,
) -> V3dSetupGroupInCorrOutputs:
    """
    Pre-process a collection of AFNI 3D+time datasets for use with Group InstaCorr.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dSetupGroupInCorr.html
    
    Args:
        datasets: AFNI 3D+time datasets to be processed.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dSetupGroupInCorrOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_SETUP_GROUP_IN_CORR_METADATA)
    cargs = []
    cargs.append("3dSetupGroupInCorr")
    cargs.append("[OPTIONS]")
    cargs.extend([execution.input_file(f) for f in datasets])
    ret = V3dSetupGroupInCorrOutputs(
        root=execution.output_file("."),
        niml_file=execution.output_file("[PREFIX].grpincorr.niml"),
        data_file=execution.output_file("[PREFIX].grpincorr.data"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dSetupGroupInCorrOutputs",
    "V_3D_SETUP_GROUP_IN_CORR_METADATA",
    "v_3d_setup_group_in_corr",
]
