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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_DIFF_METADATA = Metadata(
    id="9e9ee8f4e790b360b9a145fdfd02de7adec621c8.boutiques",
    name="3dDiff",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dDiffOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_diff(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_log: OutputPathType
    """Log file containing the element-wise differences."""


def v_3d_diff(
    dataset_a: InputPathType,
    dataset_b: InputPathType,
    runner: Runner | None = None,
) -> V3dDiffOutputs:
    """
    A program to examine element-wise differences between two images.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dDiff.html
    
    Args:
        dataset_a: First input dataset for comparison.
        dataset_b: Second input dataset for comparison.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dDiffOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_DIFF_METADATA)
    cargs = []
    cargs.append("3dDiff")
    cargs.append("[display_opt]")
    cargs.append("[-tol")
    cargs.append("TOLERANCE]")
    cargs.append("[-mask")
    cargs.append("MASK]")
    cargs.append("-a")
    cargs.extend([
        "-a",
        execution.input_file(dataset_a)
    ])
    cargs.append("-b")
    cargs.extend([
        "-b",
        execution.input_file(dataset_b)
    ])
    ret = V3dDiffOutputs(
        root=execution.output_file("."),
        output_log=execution.output_file(pathlib.Path(dataset_a).name + "_vs_" + pathlib.Path(dataset_b).name + ".log"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dDiffOutputs",
    "V_3D_DIFF_METADATA",
    "v_3d_diff",
]
