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

import typing
import pathlib
from styxdefs import *
import dataclasses

IM2NIML_METADATA = Metadata(
    id="3c92592db9d506b4424ac028f92405630d2fda18.boutiques",
    name="im2niml",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class Im2nimlOutputs(typing.NamedTuple):
    """
    Output object returned when calling `im2niml(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    niml_output: OutputPathType
    """NIML element"""


def im2niml(
    input_files: list[InputPathType],
    runner: Runner | None = None,
) -> Im2nimlOutputs:
    """
    Converts the input image(s) to a text-based NIML element and writes the result
    to stdout.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_files: Input image file(s) (e.g. image.jpg).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Im2nimlOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(IM2NIML_METADATA)
    cargs = []
    cargs.append("im2niml")
    cargs.extend([execution.input_file(f) for f in input_files])
    ret = Im2nimlOutputs(
        root=execution.output_file("."),
        niml_output=execution.output_file("stdout"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "IM2NIML_METADATA",
    "Im2nimlOutputs",
    "im2niml",
]
