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

import typing
import pathlib
from styxdefs import *
import dataclasses

REGISTER_CSH_METADATA = Metadata(
    id="8e13f3c3638f86e0bcc4bf3ee729a031f8071c67.boutiques",
    name="register.csh",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class RegisterCshOutputs(typing.NamedTuple):
    """
    Output object returned when calling `register_csh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    registered_image: OutputPathType
    """The output registered image"""


def register_csh(
    base_image: InputPathType,
    new_image: InputPathType,
    options: str | None = None,
    runner: Runner | None = None,
) -> RegisterCshOutputs:
    """
    A script for registering MRI images.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        base_image: The base image for registration.
        new_image: The new image to be registered to the base image.
        options: Additional options for the register.csh command.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `RegisterCshOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(REGISTER_CSH_METADATA)
    cargs = []
    cargs.append("register.csh")
    cargs.append(execution.input_file(base_image))
    cargs.append(execution.input_file(new_image))
    if options is not None:
        cargs.append(options)
    ret = RegisterCshOutputs(
        root=execution.output_file("."),
        registered_image=execution.output_file(pathlib.Path(new_image).name + "_registered"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "REGISTER_CSH_METADATA",
    "RegisterCshOutputs",
    "register_csh",
]
