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

import typing
import pathlib
from styxdefs import *
import dataclasses

IMAGES_EQUAL_METADATA = Metadata(
    id="830357495ce35a09c03740c89847cea1c8976199.boutiques",
    name="images_equal",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class ImagesEqualOutputs(typing.NamedTuple):
    """
    Output object returned when calling `images_equal(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    comparison_result: OutputPathType
    """Result of the image comparison: 1 if equal, 0 if not."""


def images_equal(
    file_a: InputPathType,
    file_b: InputPathType,
    all_flag: bool = False,
    runner: Runner | None = None,
) -> ImagesEqualOutputs:
    """
    A simple program to test if two 2D images are identical.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        file_a: First image file to compare.
        file_b: Second image file to compare.
        all_flag: Compare all images in the files; all must be equal for exit\
            status to be 1.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ImagesEqualOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(IMAGES_EQUAL_METADATA)
    cargs = []
    cargs.append("images_equal")
    cargs.append(execution.input_file(file_a))
    cargs.append(execution.input_file(file_b))
    if all_flag:
        cargs.append("-all")
    ret = ImagesEqualOutputs(
        root=execution.output_file("."),
        comparison_result=execution.output_file("comparison_result.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "IMAGES_EQUAL_METADATA",
    "ImagesEqualOutputs",
    "images_equal",
]
