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

import typing
import pathlib
from styxdefs import *
import dataclasses

REG2SUBJECT_METADATA = Metadata(
    id="bd548e7db5696c14e468b04f1fafbb638585f19c.boutiques",
    name="reg2subject",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Reg2subjectOutputs(typing.NamedTuple):
    """
    Output object returned when calling `reg2subject(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def reg2subject(
    regfile: InputPathType,
    runner: Runner | None = None,
) -> Reg2subjectOutputs:
    """
    Returns the name of the subject in the registration file, whether it is an LTA
    or register.dat file.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        regfile: Input registration file, either in LTA or register.dat format.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Reg2subjectOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(REG2SUBJECT_METADATA)
    cargs = []
    cargs.append("reg2subject")
    cargs.extend([
        "--r",
        execution.input_file(regfile)
    ])
    ret = Reg2subjectOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "REG2SUBJECT_METADATA",
    "Reg2subjectOutputs",
    "reg2subject",
]
