# 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_XYZ_METADATA = Metadata(
    id="5a16d2bee46238f64451cbe6e0fea267dd5ecf53.boutiques",
    name="3dNwarpXYZ",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dNwarpXyzOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_nwarp_xyz(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Warped XYZ coordinates output file"""


def v_3d_nwarp_xyz(
    warp_spec: str,
    xyzfile: InputPathType,
    runner: Runner | None = None,
) -> V3dNwarpXyzOutputs:
    """
    Transforms the DICOM xyz coordinates in the input XYZfile.1D based on specified
    warp.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        warp_spec: Warp specification as in 3dNwarpApply.
        xyzfile: XYZ coordinate file containing 3 columns.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dNwarpXyzOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_NWARP_XYZ_METADATA)
    cargs = []
    cargs.append("3dNwarpXYZ")
    cargs.append("[OPTIONS]")
    cargs.append("-nwarp")
    cargs.extend([
        "-nwarp",
        warp_spec
    ])
    cargs.append(execution.input_file(xyzfile))
    cargs.append(">")
    cargs.append("[OUTPUT_FILE]")
    ret = V3dNwarpXyzOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file("[OUTPUT_FILE]"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dNwarpXyzOutputs",
    "V_3D_NWARP_XYZ_METADATA",
    "v_3d_nwarp_xyz",
]
