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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_NWARP_APPLY_METADATA = Metadata(
    id="302efea392d797dfd8b780375733a817c0908c40.boutiques",
    name="3dNwarpApply",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dNwarpApplyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_nwarp_apply(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    warped_output: OutputPathType
    """Warped output dataset"""
    generated_warp: OutputPathType
    """Warp dataset generated during application"""


def v_3d_nwarp_apply(
    runner: Runner | None = None,
) -> V3dNwarpApplyOutputs:
    """
    Program to apply a nonlinear 3D warp saved from 3dQwarp (or 3dNwarpCat, etc.) to
    a 3D dataset, to produce a warped version of the source dataset.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dNwarpApply.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dNwarpApplyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_NWARP_APPLY_METADATA)
    cargs = []
    cargs.append("3dNwarpApply")
    cargs.append("[OPTIONS]")
    ret = V3dNwarpApplyOutputs(
        root=execution.output_file("."),
        warped_output=execution.output_file("[PREFIX]_[SOURCE]_warped.nii.gz"),
        generated_warp=execution.output_file("[WPREFIX]_warp_????.nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dNwarpApplyOutputs",
    "V_3D_NWARP_APPLY_METADATA",
    "v_3d_nwarp_apply",
]
