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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_ATTRIBUTE_METADATA = Metadata(
    id="023f5df529fe405d80f04593e71e023c5a458d03.boutiques",
    name="3dAttribute",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dAttributeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_attribute(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    stdout: OutputPathType
    """Output of the attribute value"""


def v_3d_attribute(
    aname: str,
    dset: InputPathType,
    all_: bool = False,
    name: bool = False,
    center: bool = False,
    ssep: str | None = None,
    sprep: str | None = None,
    quote: bool = False,
    runner: Runner | None = None,
) -> V3dAttributeOutputs:
    """
    Prints the value of the attribute 'aname' from the header of the dataset 'dset'.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        aname: Attribute name to be printed from the dataset.
        dset: Dataset from which the attribute value will be printed.
        all_: Print all attributes from the dataset.
        name: Include attribute name in the output.
        center: Print the center of volume in RAI coordinates.
        ssep: Use string SSEP as a separator between strings for multiple\
            sub-bricks.
        sprep: Use string SPREP to replace blank space in string attributes.
        quote: Use single quote around each string.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dAttributeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_ATTRIBUTE_METADATA)
    cargs = []
    cargs.append("3dAttribute")
    if all_:
        cargs.append("-all")
    if name:
        cargs.append("-name")
    if center:
        cargs.append("-center")
    if ssep is not None:
        cargs.extend([
            "-ssep",
            ssep
        ])
    if sprep is not None:
        cargs.extend([
            "-sprep",
            sprep
        ])
    if quote:
        cargs.append("-quote")
    cargs.append(aname)
    cargs.append(execution.input_file(dset))
    ret = V3dAttributeOutputs(
        root=execution.output_file("."),
        stdout=execution.output_file("stdout"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dAttributeOutputs",
    "V_3D_ATTRIBUTE_METADATA",
    "v_3d_attribute",
]
