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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_MOTION_CORRECT_METADATA = Metadata(
    id="3cfbb0cc88f7a83298127f974e5ce214fa8cdbf7.boutiques",
    name="mri_motion_correct",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriMotionCorrectOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_motion_correct(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    corrected_outfile: OutputPathType
    """Corrected MRI image output file."""


def mri_motion_correct(
    outfile: str,
    infiles: list[InputPathType],
    runner: Runner | None = None,
) -> MriMotionCorrectOutputs:
    """
    Tool for correcting motion in MRI scans.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        outfile: Output file where the corrected MRI image(s) will be stored.
        infiles: Input MRI image files to be corrected.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriMotionCorrectOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_MOTION_CORRECT_METADATA)
    cargs = []
    cargs.append("mri_motion_correct")
    cargs.append(outfile)
    cargs.extend([execution.input_file(f) for f in infiles])
    ret = MriMotionCorrectOutputs(
        root=execution.output_file("."),
        corrected_outfile=execution.output_file(outfile),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_MOTION_CORRECT_METADATA",
    "MriMotionCorrectOutputs",
    "mri_motion_correct",
]
