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

import typing
import pathlib
from styxdefs import *
import dataclasses

ANATOMICAL_AVERAGE_METADATA = Metadata(
    id="4d1ca27f9d946d87c62899d1b8d9e62d2557220d.boutiques",
    name="AnatomicalAverage",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class AnatomicalAverageOutputs(typing.NamedTuple):
    """
    Output object returned when calling `anatomical_average(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    avg_output: OutputPathType
    """Averaged anatomical image"""


def anatomical_average(
    output_basename: str,
    input_images: list[InputPathType],
    runner: Runner | None = None,
) -> AnatomicalAverageOutputs:
    """
    Tool to create an anatomical average of input brain images.
    
    Author: Brain Imaging Center
    
    URL: https://example.com/anatomicalaverage
    
    Args:
        output_basename: Output basename.
        input_images: List of input images.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `AnatomicalAverageOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ANATOMICAL_AVERAGE_METADATA)
    cargs = []
    cargs.append("AnatomicalAverage")
    cargs.append("[OPTIONAL_ARGS]")
    cargs.append("-o")
    cargs.extend([
        "-o",
        output_basename
    ])
    cargs.extend([execution.input_file(f) for f in input_images])
    ret = AnatomicalAverageOutputs(
        root=execution.output_file("."),
        avg_output=execution.output_file(output_basename + "_avg.nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ANATOMICAL_AVERAGE_METADATA",
    "AnatomicalAverageOutputs",
    "anatomical_average",
]
