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

import typing
import pathlib
from styxdefs import *
import dataclasses

MKXSUBJREG_METADATA = Metadata(
    id="e782131163109567ec01cead15e999955396aeed.boutiques",
    name="mkxsubjreg",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mkxsubjreg(
    srcreg: InputPathType,
    targreg: InputPathType,
    targsubj: str | None = None,
    xfm: str | None = None,
    sd: str | None = None,
    fvol: InputPathType | None = None,
    help_: bool = False,
    version: bool = False,
    runner: Runner | None = None,
) -> MkxsubjregOutputs:
    """
    Creates a new registration matrix that maps from the functional volume of the
    source subject to the orig of the target subject through the talairach
    transform.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        srcreg: Path to the source registration file (srcreg.dat).
        targreg: Path to the target registration file (targreg.dat).
        targsubj: Target subject ID; default is talairach.
        xfm: XFM file name relative to transforms.
        sd: Directory containing subject data; default is env SUBJECTS_DIR.
        fvol: Path to example functional volume.
        help_: Display help information.
        version: Display version information.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MkxsubjregOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MKXSUBJREG_METADATA)
    cargs = []
    cargs.append("mkxsubjreg")
    cargs.extend([
        "--srcreg",
        execution.input_file(srcreg)
    ])
    cargs.extend([
        "--targreg",
        execution.input_file(targreg)
    ])
    if targsubj is not None:
        cargs.extend([
            "--targsubj",
            targsubj
        ])
    if xfm is not None:
        cargs.extend([
            "--xfm",
            xfm
        ])
    if sd is not None:
        cargs.extend([
            "--sd",
            sd
        ])
    if fvol is not None:
        cargs.extend([
            "--fvol",
            execution.input_file(fvol)
        ])
    if help_:
        cargs.append("--help")
    if version:
        cargs.append("--version")
    ret = MkxsubjregOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MKXSUBJREG_METADATA",
    "MkxsubjregOutputs",
    "mkxsubjreg",
]
