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

import typing
import pathlib
from styxdefs import *
import dataclasses

REG_MNI305_2MM_METADATA = Metadata(
    id="baca96deead4a89fad3eca8defaa337786ee5cdf.boutiques",
    name="reg-mni305.2mm",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class RegMni3052mmOutputs(typing.NamedTuple):
    """
    Output object returned when calling `reg_mni305_2mm(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_regfile: OutputPathType
    """tkregister2-style registration matrix output file."""


def reg_mni305_2mm(
    subject_id: str,
    regfile: InputPathType,
    runner: Runner | None = None,
) -> RegMni3052mmOutputs:
    """
    Computes the registration between the FreeSurfer MNI305 2mm space and a
    subject's FreeSurfer anatomical space.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_id: Subject ID for the FreeSurfer anatomical space.
        regfile: tkregister2-style registration matrix file (should have a .dat\
            or .reg extension).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `RegMni3052mmOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(REG_MNI305_2MM_METADATA)
    cargs = []
    cargs.append("reg-mni305.2mm")
    cargs.extend([
        "--s",
        subject_id
    ])
    cargs.extend([
        "--reg",
        execution.input_file(regfile)
    ])
    ret = RegMni3052mmOutputs(
        root=execution.output_file("."),
        output_regfile=execution.output_file(pathlib.Path(regfile).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "REG_MNI305_2MM_METADATA",
    "RegMni3052mmOutputs",
    "reg_mni305_2mm",
]
