# 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_FSL_METADATA = Metadata(
    id="e4429f150e08917f7317e164c448c83b94352eed.boutiques",
    name="mri_motion_correct.fsl",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriMotionCorrectFslOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_motion_correct_fsl(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    corrected_output: OutputPathType
    """Motion corrected output MRI image"""


def mri_motion_correct_fsl(
    input_image: InputPathType,
    output_image: str,
    runner: Runner | None = None,
) -> MriMotionCorrectFslOutputs:
    """
    Tool for motion correction of MRI images using FSL.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_image: Input MRI image to be motion corrected.
        output_image: Output corrected MRI image.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriMotionCorrectFslOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_MOTION_CORRECT_FSL_METADATA)
    cargs = []
    cargs.append("mri_motion_correct.fsl")
    cargs.append(execution.input_file(input_image))
    cargs.append(output_image)
    cargs.append("[OPTIONS]")
    ret = MriMotionCorrectFslOutputs(
        root=execution.output_file("."),
        corrected_output=execution.output_file(output_image + ".nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_MOTION_CORRECT_FSL_METADATA",
    "MriMotionCorrectFslOutputs",
    "mri_motion_correct_fsl",
]
