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

import typing
import pathlib
from styxdefs import *
import dataclasses

ATLASQUERY_METADATA = Metadata(
    id="01942ea09300720e7fb04693272806c8ad89763b.boutiques",
    name="atlasquery",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


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


def atlasquery(
    dumpatlases_flag: bool = False,
    atlas: str | None = None,
    coord: str | None = None,
    mask: InputPathType | None = None,
    verbose_flag: bool = False,
    help_flag: bool = False,
    runner: Runner | None = None,
) -> AtlasqueryOutputs:
    """
    Structural lookup tool for FSL atlases.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Atlasquery
    
    Args:
        dumpatlases_flag: Dump a list of available atlases.
        atlas: Name of atlas to use.
        coord: Coordinate to query in the format X,Y,Z.
        mask: A mask image to use during structural lookups.
        verbose_flag: Switch on diagnostic messages.
        help_flag: Show help message and exit.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `AtlasqueryOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ATLASQUERY_METADATA)
    cargs = []
    cargs.append("atlasq")
    cargs.append("ohi")
    if dumpatlases_flag:
        cargs.append("--dumpatlases")
    if atlas is not None:
        cargs.extend([
            "-a",
            atlas
        ])
    if coord is not None:
        cargs.extend([
            "-c",
            coord
        ])
    if mask is not None:
        cargs.extend([
            "-m",
            execution.input_file(mask)
        ])
    if verbose_flag:
        cargs.append("-V")
    if help_flag:
        cargs.append("-h")
    ret = AtlasqueryOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ATLASQUERY_METADATA",
    "AtlasqueryOutputs",
    "atlasquery",
]
