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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIRST_MULT_BCORR_METADATA = Metadata(
    id="a7d6c8e2e8974e5facac9a650b214397ba549860.boutiques",
    name="first_mult_bcorr",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class FirstMultBcorrOutputs(typing.NamedTuple):
    """
    Output object returned when calling `first_mult_bcorr(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Output image name (3D label image)"""


def first_mult_bcorr(
    input_image: InputPathType,
    corrected_4d_labels: InputPathType,
    uncorrected_4d_labels: InputPathType,
    output_image: str,
    verbose_flag: bool = False,
    runner: Runner | None = None,
) -> FirstMultBcorrOutputs:
    """
    Part of FSL (ID: 6.0.5:9e026117), first_mult_bcorr converts label images to an
    output image.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        input_image: Filename of original T1 input image.
        corrected_4d_labels: Filename of 4D image of individually corrected\
            labels.
        uncorrected_4d_labels: Filename of 4D image of uncorrected labels (with\
            boundaries).
        output_image: Output image name (3D label image).
        verbose_flag: Output F-stats to standard out.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FirstMultBcorrOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIRST_MULT_BCORR_METADATA)
    cargs = []
    cargs.append("first_mult_bcorr")
    cargs.extend([
        "-i",
        execution.input_file(input_image)
    ])
    cargs.extend([
        "-c",
        execution.input_file(corrected_4d_labels)
    ])
    cargs.extend([
        "-u",
        execution.input_file(uncorrected_4d_labels)
    ])
    cargs.extend([
        "-o",
        output_image
    ])
    if verbose_flag:
        cargs.append("-v")
    ret = FirstMultBcorrOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(output_image),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIRST_MULT_BCORR_METADATA",
    "FirstMultBcorrOutputs",
    "first_mult_bcorr",
]
