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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_FFT_METADATA = Metadata(
    id="851402de6e59bb412e16d2fd29f106f1673bae6d.boutiques",
    name="3dFFT",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dFftOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_fft(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_dataset: OutputPathType
    """Output dataset generated by 3dFFT."""


def v_3d_fft(
    dataset: InputPathType,
    runner: Runner | None = None,
) -> V3dFftOutputs:
    """
    Performs the FFT of the input dataset in 3 directions (x, y, z) and produces the
    output dataset.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dFFT.html
    
    Args:
        dataset: Input dataset (e.g., dataset.nii).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dFftOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_FFT_METADATA)
    cargs = []
    cargs.append("3dFFT")
    cargs.append("[--abs]")
    cargs.append("[--phase]")
    cargs.append("[--complex]")
    cargs.append("[--inverse]")
    cargs.append("[--Lx")
    cargs.append("X_LENGTH]")
    cargs.append("[--Ly")
    cargs.append("Y_LENGTH]")
    cargs.append("[--Lz")
    cargs.append("Z_LENGTH]")
    cargs.append("[--altIN]")
    cargs.append("[--altOUT]")
    cargs.append("[--input")
    cargs.append("INPUT_FILE]")
    cargs.append("[--prefix")
    cargs.append("PREFIX]")
    cargs.append(execution.input_file(dataset))
    ret = V3dFftOutputs(
        root=execution.output_file("."),
        output_dataset=execution.output_file("[PREFIX].nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dFftOutputs",
    "V_3D_FFT_METADATA",
    "v_3d_fft",
]
