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

import typing
import pathlib
from styxdefs import *
import dataclasses

FABBER_DCE_METADATA = Metadata(
    id="86a1dfb3ab7189eb7050b42d679d660cf3289061.boutiques",
    name="fabber_dce",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class FabberDceOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fabber_dce(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_files: OutputPathType
    """Files generated by Fabber DCE"""


def fabber_dce(
    forward_model: str,
    inference_method: str,
    input_data: InputPathType,
    output_directory: str,
    runner: Runner | None = None,
) -> FabberDceOutputs:
    """
    Fabber DCE analysis tool for model-based analysis of dynamic contrast-enhanced
    imaging data.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fabber-core.readthedocs.io/
    
    Args:
        forward_model: Forward model to use.
        inference_method: Inference method to use.
        input_data: Single input data file.
        output_directory: Directory for output files (including logfile).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FabberDceOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FABBER_DCE_METADATA)
    cargs = []
    cargs.append("fabber")
    cargs.extend([
        "--model",
        forward_model
    ])
    cargs.extend([
        "--method",
        inference_method
    ])
    cargs.extend([
        "--data",
        execution.input_file(input_data)
    ])
    cargs.append("--output")
    cargs.extend([
        "--output",
        output_directory
    ])
    cargs.append("[OPTIONS]")
    ret = FabberDceOutputs(
        root=execution.output_file("."),
        output_files=execution.output_file(output_directory + "/*"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FABBER_DCE_METADATA",
    "FabberDceOutputs",
    "fabber_dce",
]
