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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_2DCAT_METADATA = Metadata(
    id="56683a58e70bc4cb5e35cd2aa07ec487e9a471e1.boutiques",
    name="2dcat",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V2dcatOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_2dcat(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_image: OutputPathType
    """The main output image matrix file."""
    output_1_d: OutputPathType
    """A 1D file containing the average of RGB values, if the prefix ends with
    .1D."""


def v_2dcat(
    filenames: list[InputPathType],
    runner: Runner | None = None,
) -> V2dcatOutputs:
    """
    Puts a set of images into an image matrix montage of NX by NY images.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/2dcat.html
    
    Args:
        filenames: List of input image files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V2dcatOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_2DCAT_METADATA)
    cargs = []
    cargs.append("2dcat")
    cargs.append("[OPTIONS]")
    cargs.extend([execution.input_file(f) for f in filenames])
    ret = V2dcatOutputs(
        root=execution.output_file("."),
        output_image=execution.output_file("[PREFIX].ppm"),
        output_1_d=execution.output_file("[PREFIX].1D"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V2dcatOutputs",
    "V_2DCAT_METADATA",
    "v_2dcat",
]
