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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_RETINO_PHASE_METADATA = Metadata(
    id="3fcf125ca005c8d78e8e888d9df0d963f73cc8fb.boutiques",
    name="3dRetinoPhase",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dRetinoPhaseOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_retino_phase(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    ecc_plus: OutputPathType
    """Output file for positive (expanding) eccentricity"""
    ecc_minus: OutputPathType
    """Output file for negative (contracting) eccentricity"""
    pol_plus: OutputPathType
    """Output file for clockwise polar angle mapping"""
    pol_minus: OutputPathType
    """Output file for counterclockwise polar angle mapping"""


def v_3d_retino_phase(
    prefix: str,
    dataset: InputPathType,
    runner: Runner | None = None,
) -> V3dRetinoPhaseOutputs:
    """
    Process time series from retinotopy stimuli to create phase datasets and visual
    field angle datasets.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dRetinoPhase.html
    
    Args:
        prefix: Prefix of output datasets.
        dataset: Time series from a retinotopy stimulus.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dRetinoPhaseOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_RETINO_PHASE_METADATA)
    cargs = []
    cargs.append("3dRetinoPhase")
    cargs.append(prefix)
    cargs.append(execution.input_file(dataset))
    cargs.append("[OPTIONS]")
    ret = V3dRetinoPhaseOutputs(
        root=execution.output_file("."),
        ecc_plus=execution.output_file("[PREFIX].ecc+"),
        ecc_minus=execution.output_file("[PREFIX].ecc-"),
        pol_plus=execution.output_file("[PREFIX].pol+"),
        pol_minus=execution.output_file("[PREFIX].pol-"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dRetinoPhaseOutputs",
    "V_3D_RETINO_PHASE_METADATA",
    "v_3d_retino_phase",
]
