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

import typing
import pathlib
from styxdefs import *
import dataclasses

POSSUM_INTERPMOT_PY_METADATA = Metadata(
    id="c34391e653c9cbe437b81104094754d85af56ce2.boutiques",
    name="possum_interpmot.py",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class PossumInterpmotPyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `possum_interpmot_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfile: OutputPathType
    """Interpolated motion output file"""


def possum_interpmot_py(
    motion_type: int,
    tr: float,
    tr_slice: float,
    nslices: int,
    nvols: int,
    custom_motion_file: InputPathType,
    output_file: str,
    runner: Runner | None = None,
) -> PossumInterpmotPyOutputs:
    """
    Position Interpolation for Movers and Shakers.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk
    
    Args:
        motion_type: Type of motion: 0 for continuous, 1 for between slices, 2\
            for between volumes.
        tr: Repetition time in seconds.
        tr_slice: Slice repetition time in seconds.
        nslices: Number of slices.
        nvols: Number of volumes.
        custom_motion_file: Custom motion file.
        output_file: Output file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `PossumInterpmotPyOutputs`).
    """
    if not (0 <= motion_type <= 2): 
        raise ValueError(f"'motion_type' must be between 0 <= x <= 2 but was {motion_type}")
    runner = runner or get_global_runner()
    execution = runner.start_execution(POSSUM_INTERPMOT_PY_METADATA)
    cargs = []
    cargs.append("/usr/local/fsl/bin/possum_interpmot.py")
    cargs.append(str(motion_type))
    cargs.append(str(tr))
    cargs.append(str(tr_slice))
    cargs.append(str(nslices))
    cargs.append(str(nvols))
    cargs.append(execution.input_file(custom_motion_file))
    cargs.append(output_file)
    ret = PossumInterpmotPyOutputs(
        root=execution.output_file("."),
        outfile=execution.output_file(output_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "POSSUM_INTERPMOT_PY_METADATA",
    "PossumInterpmotPyOutputs",
    "possum_interpmot_py",
]
