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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_LOCAL_PV_METADATA = Metadata(
    id="5df8cc09196eb6e730189ac4f20e1ba919667117.boutiques",
    name="3dLocalPV",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dLocalPvOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_local_pv(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    svd_vector_result: OutputPathType
    """SVD vector result dataset"""
    second_principal_vector: OutputPathType
    """Second principal vector dataset"""
    singular_value: OutputPathType
    """Singular value at each voxel dataset"""


def v_3d_local_pv(
    input_dataset: InputPathType,
    runner: Runner | None = None,
) -> V3dLocalPvOutputs:
    """
    Computes the Singular Value Decomposition (SVD) of the time series from a
    neighborhood of each voxel in a 3D+time dataset, which serves as a smoothing
    method for the dataset.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dLocalPV.html
    
    Args:
        input_dataset: Input time series dataset.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dLocalPvOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_LOCAL_PV_METADATA)
    cargs = []
    cargs.append("3dLocalPV")
    cargs.append("[OPTIONS]")
    cargs.append(execution.input_file(input_dataset))
    ret = V3dLocalPvOutputs(
        root=execution.output_file("."),
        svd_vector_result=execution.output_file("[PREFIX].nii.gz"),
        second_principal_vector=execution.output_file("[PREFIX2].nii.gz"),
        singular_value=execution.output_file("[EVPREFIX].nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dLocalPvOutputs",
    "V_3D_LOCAL_PV_METADATA",
    "v_3d_local_pv",
]
