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

import typing
import pathlib
from styxdefs import *
import dataclasses

RMSDIFF_METADATA = Metadata(
    id="721e867f6f94c898ce8453a6c1d46d329b31f94e.boutiques",
    name="rmsdiff",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


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


def rmsdiff(
    matrixfile1: InputPathType,
    matrixfile2: InputPathType,
    refvol: InputPathType,
    mask: InputPathType | None = None,
    runner: Runner | None = None,
) -> RmsdiffOutputs:
    """
    Outputs RMS deviation between matrices (in mm).
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        matrixfile1: First matrix file.
        matrixfile2: Second matrix file.
        refvol: Reference volume.
        mask: Optional mask.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `RmsdiffOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(RMSDIFF_METADATA)
    cargs = []
    cargs.append("rmsdiff")
    cargs.append(execution.input_file(matrixfile1))
    cargs.append(execution.input_file(matrixfile2))
    cargs.append(execution.input_file(refvol))
    if mask is not None:
        cargs.append(execution.input_file(mask))
    ret = RmsdiffOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "RMSDIFF_METADATA",
    "RmsdiffOutputs",
    "rmsdiff",
]
