# 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_PREFIX_METADATA = Metadata(
    id="319f4b6f23c4fb2f22807441a53e5648683d8b96.boutiques",
    name="@GetAfniPrefix",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VGetAfniPrefixOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__get_afni_prefix(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def v__get_afni_prefix(
    name: InputPathType,
    suffix: str | None = None,
    runner: Runner | None = None,
) -> VGetAfniPrefixOutputs:
    """
    A tool to extract AFNI prefix from a given file path.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/@GetAfniPrefix.html
    
    Args:
        name: Input file path for which the AFNI prefix will be extracted.
        suffix: Suffix string to append to the returned prefix.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VGetAfniPrefixOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__GET_AFNI_PREFIX_METADATA)
    cargs = []
    cargs.append("@GetAfniPrefix")
    cargs.append(execution.input_file(name))
    if suffix is not None:
        cargs.append(suffix)
    ret = VGetAfniPrefixOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VGetAfniPrefixOutputs",
    "V__GET_AFNI_PREFIX_METADATA",
    "v__get_afni_prefix",
]
