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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_AFNITO3_D_METADATA = Metadata(
    id="51230e7f67f1e0eb607573872e1507d7fe45f41a.boutiques",
    name="3dAFNIto3D",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dAfnito3DOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_afnito3_d(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfile: OutputPathType
    """Output 3D file, either in binary or text format"""


def v_3d_afnito3_d(
    dataset: InputPathType,
    runner: Runner | None = None,
) -> V3dAfnito3DOutputs:
    """
    Reads in an AFNI dataset, and writes it out as a 3D file.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        dataset: AFNI dataset to be converted.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dAfnito3DOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_AFNITO3_D_METADATA)
    cargs = []
    cargs.append("3dAFNIto3D")
    cargs.append("[OPTIONS]")
    cargs.append(execution.input_file(dataset))
    ret = V3dAfnito3DOutputs(
        root=execution.output_file("."),
        outfile=execution.output_file("[PREFIX].3D"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dAfnito3DOutputs",
    "V_3D_AFNITO3_D_METADATA",
    "v_3d_afnito3_d",
]
