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

import typing
import pathlib
from styxdefs import *
import dataclasses

BASIL_VAR_METADATA = Metadata(
    id="ef2d05e150b63d8d6121c52d86fea7583edc0338.boutiques",
    name="basil_var",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


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


def basil_var(
    results_dir: str,
    mask_image: InputPathType,
    runner: Runner | None = None,
) -> BasilVarOutputs:
    """
    Variance calculator for BASIL.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        results_dir: BASIL results directory.
        mask_image: Mask image.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `BasilVarOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(BASIL_VAR_METADATA)
    cargs = []
    cargs.append("basil_var")
    cargs.extend([
        "-d",
        results_dir
    ])
    cargs.extend([
        "-m",
        execution.input_file(mask_image)
    ])
    ret = BasilVarOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "BASIL_VAR_METADATA",
    "BasilVarOutputs",
    "basil_var",
]
