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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_EXCHANGE_METADATA = Metadata(
    id="5e04c8d2b1860f0ec51964e8b982b73eaddf8469.boutiques",
    name="3dExchange",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dExchangeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_exchange(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_head: OutputPathType
    """Output HEAD file"""
    output_brik: OutputPathType
    """Output BRIK file"""


def v_3d_exchange(
    prefix: str,
    infile: InputPathType,
    mapfile: InputPathType,
    version: bool = False,
    help_: bool = False,
    runner: Runner | None = None,
) -> V3dExchangeOutputs:
    """
    Replaces voxel values using a mapping file with specified columns.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        prefix: Output prefix.
        infile: Input dataset. Acceptable data types are byte, short, and\
            floats.
        mapfile: Mapping columns. Input values in the first column, output\
            values in the second column.
        version: Print author and version info.
        help_: Print this help screen.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dExchangeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_EXCHANGE_METADATA)
    cargs = []
    cargs.append("3dExchange")
    cargs.extend([
        "-prefix",
        prefix
    ])
    cargs.extend([
        "-input",
        execution.input_file(infile)
    ])
    cargs.extend([
        "-map",
        execution.input_file(mapfile)
    ])
    if version:
        cargs.append("-ver")
    if help_:
        cargs.append("-help")
    ret = V3dExchangeOutputs(
        root=execution.output_file("."),
        output_head=execution.output_file(prefix + "+orig.HEAD"),
        output_brik=execution.output_file(prefix + "+orig.BRIK"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dExchangeOutputs",
    "V_3D_EXCHANGE_METADATA",
    "v_3d_exchange",
]
