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

import typing
import pathlib
from styxdefs import *
import dataclasses

FABBER_PET_METADATA = Metadata(
    id="46f5abb89eb6fa6d38c0da06d9a7cd2f69e1cd75.boutiques",
    name="fabber_pet",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class FabberPetOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fabber_pet(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_files: OutputPathType
    """Directory containing output files including logfile"""
    param_names_file: OutputPathType
    """File containing the names of the model parameters if --dump-param-names
    is used"""
    model_fit_file: OutputPathType
    """4D volume containing the model prediction if --save-model-fit is used"""
    residuals_file: OutputPathType
    """4D volume containing the residuals if --save-residuals is used"""
    model_extras_file: OutputPathType
    """4D volume containing additional model-specific timeseries data if
    --save-model-extras is used"""
    mvn_file: OutputPathType
    """4D volume containing the final MVN distributions if --save-mvn is used"""
    mean_file: OutputPathType
    """4D volume containing the parameter means if --save-mean is used"""
    std_file: OutputPathType
    """4D volume containing the parameter standard deviations if --save-std is
    used"""
    var_file: OutputPathType
    """4D volume containing the parameter variances if --save-var is used"""
    zstat_file: OutputPathType
    """4D volume containing the parameter z-stats if --save-zstat is used"""
    noise_mean_file: OutputPathType
    """4D volume containing the noise means if --save-noise-mean is used"""
    noise_std_file: OutputPathType
    """4D volume containing the noise standard deviations if --save-noise-std is
    used"""
    free_energy_file: OutputPathType
    """4D volume containing the free energy if calculated and if
    --save-free-energy is used"""


def fabber_pet(
    runner: Runner | None = None,
) -> FabberPetOutputs:
    """
    Fabber Bayesian Model Fitting Tool.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Fabber
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FabberPetOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FABBER_PET_METADATA)
    cargs = []
    cargs.append("fabber")
    cargs.append("[OPTIONS]")
    ret = FabberPetOutputs(
        root=execution.output_file("."),
        output_files=execution.output_file("[OUTPUT]/*"),
        param_names_file=execution.output_file("[OUTPUT]/paramnames.txt"),
        model_fit_file=execution.output_file("[OUTPUT]/*_modelfit.nii.gz"),
        residuals_file=execution.output_file("[OUTPUT]/*_residuals.nii.gz"),
        model_extras_file=execution.output_file("[OUTPUT]/*_modextras.nii.gz"),
        mvn_file=execution.output_file("[OUTPUT]/*_mvn.nii.gz"),
        mean_file=execution.output_file("[OUTPUT]/*_mean.nii.gz"),
        std_file=execution.output_file("[OUTPUT]/*_std.nii.gz"),
        var_file=execution.output_file("[OUTPUT]/*_var.nii.gz"),
        zstat_file=execution.output_file("[OUTPUT]/*_zstat.nii.gz"),
        noise_mean_file=execution.output_file("[OUTPUT]/*_noisemean.nii.gz"),
        noise_std_file=execution.output_file("[OUTPUT]/*_noisestd.nii.gz"),
        free_energy_file=execution.output_file("[OUTPUT]/*_freeenergy.nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FABBER_PET_METADATA",
    "FabberPetOutputs",
    "fabber_pet",
]
