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

import typing
import pathlib
from styxdefs import *
import dataclasses

MIDTRANS_METADATA = Metadata(
    id="b39eff2ab1a7b0607739374c3b6c7f807e455f79.boutiques",
    name="midtrans",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


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


def midtrans(
    transforms: list[InputPathType],
    runner: Runner | None = None,
) -> MidtransOutputs:
    """
    Calculate the midpoint transform from a series of input transforms.
    
    Author: University of Oxford (Mark Jenkinson)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/
    
    Args:
        transforms: List of input transform files (e.g. transform1.mat\
            transform2.mat ... transformN.mat).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MidtransOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MIDTRANS_METADATA)
    cargs = []
    cargs.append("midtrans")
    cargs.append("[OPTIONS]")
    cargs.extend([execution.input_file(f) for f in transforms])
    cargs.append("[TRANSFORM2]")
    cargs.append("...")
    cargs.append("[TRANSFORMN]")
    ret = MidtransOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MIDTRANS_METADATA",
    "MidtransOutputs",
    "midtrans",
]
