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

import typing
import pathlib
from styxdefs import *
import dataclasses

TKREGISTER2_METADATA = Metadata(
    id="3353439d51377eb469f4afa76a77785eef2763ae.boutiques",
    name="tkregister2",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Tkregister2Outputs(typing.NamedTuple):
    """
    Output object returned when calling `tkregister2(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_reg_file: OutputPathType
    """Resulting registration file"""


def tkregister2(
    fixed_volume: InputPathType,
    moving_volume: InputPathType,
    reg_file: InputPathType,
    runner: Runner | None = None,
) -> Tkregister2Outputs:
    """
    tkregister2 is a tool from FreeSurfer used for registration of MRI images.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        fixed_volume: Fixed volume (e.g., anatomical image).
        moving_volume: Moving volume (e.g., functional image).
        reg_file: Registration file to be saved or loaded.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Tkregister2Outputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(TKREGISTER2_METADATA)
    cargs = []
    cargs.append("tkregister2")
    cargs.append(execution.input_file(fixed_volume))
    cargs.append(execution.input_file(moving_volume))
    cargs.append(execution.input_file(reg_file))
    cargs.append("[COMMAND_OPTIONS]")
    ret = Tkregister2Outputs(
        root=execution.output_file("."),
        output_reg_file=execution.output_file(pathlib.Path(reg_file).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "TKREGISTER2_METADATA",
    "Tkregister2Outputs",
    "tkregister2",
]
