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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_OVERLAP_METADATA = Metadata(
    id="a1bc040d8dc7e5b89536a75a10ba6ad55a1ecc95.boutiques",
    name="3dOverlap",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dOverlapOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_overlap(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_brik: OutputPathType
    """BRIK file with count of overlaps at each voxel (if -save is used)"""
    output_head: OutputPathType
    """HEAD file with count of overlaps at each voxel (if -save is used)"""


def v_3d_overlap(
    dataset1: InputPathType,
    dataset2: list[InputPathType],
    runner: Runner | None = None,
) -> V3dOverlapOutputs:
    """
    Counts the number of voxels that are nonzero in all input datasets.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        dataset1: First input dataset (e.g. dset1+orig).
        dataset2: Second input dataset (e.g. dset2+orig).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dOverlapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_OVERLAP_METADATA)
    cargs = []
    cargs.append("3dOverlap")
    cargs.append("[OPTIONS]")
    cargs.append(execution.input_file(dataset1))
    cargs.extend([execution.input_file(f) for f in dataset2])
    ret = V3dOverlapOutputs(
        root=execution.output_file("."),
        output_brik=execution.output_file("[SAVE_PREFIX]+orig.BRIK"),
        output_head=execution.output_file("[SAVE_PREFIX]+orig.HEAD"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dOverlapOutputs",
    "V_3D_OVERLAP_METADATA",
    "v_3d_overlap",
]
