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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_LINEAR_REGISTER_METADATA = Metadata(
    id="0c492f9c37f4a6d5857023e8af8887cc8eee392c.boutiques",
    name="mri_linear_register",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriLinearRegisterOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_linear_register(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_registered_image: OutputPathType
    """The registered brain image"""


def mri_linear_register(
    input_brain: InputPathType,
    template: InputPathType,
    output_file: str,
    runner: Runner | None = None,
) -> MriLinearRegisterOutputs:
    """
    A tool for linear registration of MRI brain images to a template.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_brain: Input brain image to be registered.
        template: Template to which the brain image will be registered.
        output_file: Output file name for the registered brain image.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriLinearRegisterOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_LINEAR_REGISTER_METADATA)
    cargs = []
    cargs.append("mri_linear_register")
    cargs.append(execution.input_file(input_brain))
    cargs.append(execution.input_file(template))
    cargs.append(output_file)
    ret = MriLinearRegisterOutputs(
        root=execution.output_file("."),
        output_registered_image=execution.output_file(output_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_LINEAR_REGISTER_METADATA",
    "MriLinearRegisterOutputs",
    "mri_linear_register",
]
