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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_QWARP_METADATA = Metadata(
    id="862e17640b27936f88c1ff1e669f35719de1ac81.boutiques",
    name="3dQwarp",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dQwarpOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_qwarp(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    warped_dataset: OutputPathType
    """Warped dataset"""
    warp_dataset: OutputPathType
    """Warp dataset"""
    inverse_warp_dataset: OutputPathType
    """Inverse warp dataset"""


def v_3d_qwarp(
    base_dataset: InputPathType,
    source_dataset: InputPathType,
    prefix: str,
    runner: Runner | None = None,
) -> V3dQwarpOutputs:
    """
    Computes a nonlinearly warped version of source_dataset to match base_dataset.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dQwarp.html
    
    Args:
        base_dataset: Base dataset.
        source_dataset: Source dataset.
        prefix: Prefix for the output datasets.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dQwarpOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_QWARP_METADATA)
    cargs = []
    cargs.append("3dQwarp")
    cargs.append("-base")
    cargs.append(execution.input_file(base_dataset))
    cargs.append("-source")
    cargs.append(execution.input_file(source_dataset))
    cargs.append("-prefix")
    cargs.append(prefix)
    cargs.append("[OPTIONS]")
    ret = V3dQwarpOutputs(
        root=execution.output_file("."),
        warped_dataset=execution.output_file("{PREFIX}+tlrc"),
        warp_dataset=execution.output_file("{PREFIX}_WARP+tlrc"),
        inverse_warp_dataset=execution.output_file("{PREFIX}_WARPINV+tlrc"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dQwarpOutputs",
    "V_3D_QWARP_METADATA",
    "v_3d_qwarp",
]
