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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__GET_AFNI_ORIENT_METADATA = Metadata(
    id="f8dbdeb31f2cb6c6cd4aea993002d6be907c16b0.boutiques",
    name="@GetAfniOrient",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VGetAfniOrientOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__get_afni_orient(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_orient_code: OutputPathType
    """File containing the orientation code"""


def v__get_afni_orient(
    infile: InputPathType,
    exploratory: bool = False,
    runner: Runner | None = None,
) -> VGetAfniOrientOutputs:
    """
    Returns the orient code of AFNI datasets.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        infile: Input AFNI dataset (e.g. Hello+orig.HEAD).
        exploratory: Exploratory flag for additional functionalities.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VGetAfniOrientOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__GET_AFNI_ORIENT_METADATA)
    cargs = []
    cargs.append("@GetAfniOrient")
    if exploratory:
        cargs.append("-exp")
    cargs.append(execution.input_file(infile))
    ret = VGetAfniOrientOutputs(
        root=execution.output_file("."),
        output_orient_code=execution.output_file(pathlib.Path(infile).name + "_orient_code.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VGetAfniOrientOutputs",
    "V__GET_AFNI_ORIENT_METADATA",
    "v__get_afni_orient",
]
