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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_TSPLIT4_D_METADATA = Metadata(
    id="861535b6c29e168191a0da4498bda4b743f855bf.boutiques",
    name="3dTsplit4D",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dTsplit4DOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_tsplit4_d(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfiles: OutputPathType
    """Multiple 3D single-brick output files"""


def v_3d_tsplit4_d(
    prefix: str,
    infile: InputPathType,
    keep_datum: bool = False,
    digits: float | None = None,
    runner: Runner | None = None,
) -> V3dTsplit4DOutputs:
    """
    Convert a 3D+time dataset into multiple 3D single-brick files.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        prefix: Prefix of the output datasets (e.g., out/epi).
        infile: Input 3D+time dataset (e.g., epi_r1+orig).
        keep_datum: Output uses original datum (no conversion to float).
        digits: Number of digits to use for output filenames.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dTsplit4DOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_TSPLIT4_D_METADATA)
    cargs = []
    cargs.append("3dTsplit4D")
    cargs.extend([
        "-prefix",
        prefix
    ])
    cargs.append(execution.input_file(infile))
    if keep_datum:
        cargs.append("-keep_datum")
    if digits is not None:
        cargs.extend([
            "-digits",
            str(digits)
        ])
    ret = V3dTsplit4DOutputs(
        root=execution.output_file("."),
        outfiles=execution.output_file(prefix + "*"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dTsplit4DOutputs",
    "V_3D_TSPLIT4_D_METADATA",
    "v_3d_tsplit4_d",
]
