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

import typing
import pathlib
from styxdefs import *
import dataclasses

TALAIRACH_AVI_METADATA = Metadata(
    id="678baef5e6c260dfc7bf384b2e8261c153d14240.boutiques",
    name="talairach_avi",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class TalairachAviOutputs(typing.NamedTuple):
    """
    Output object returned when calling `talairach_avi(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_xfm_file: OutputPathType
    """Output transform file"""


def talairach_avi(
    input_file: InputPathType,
    output_xfm: str,
    atlas: str | None = None,
    log: str | None = None,
    debug: bool = False,
    runner: Runner | None = None,
) -> TalairachAviOutputs:
    """
    Front-end for Avi Snyder's image registration tool. Computes the Talairach
    transform that maps the input volume to the MNI average_305.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_file: Input volume.
        output_xfm: Output transform file.
        atlas: Alternate target atlas (in freesurfer/average dir).
        log: Log file. Default is outdir/talairach_avi.log.
        debug: Turn on debugging.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `TalairachAviOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(TALAIRACH_AVI_METADATA)
    cargs = []
    cargs.append("talairach_avi")
    cargs.extend([
        "--i",
        execution.input_file(input_file)
    ])
    cargs.extend([
        "--xfm",
        output_xfm
    ])
    if atlas is not None:
        cargs.extend([
            "--atlas",
            atlas
        ])
    if log is not None:
        cargs.extend([
            "--log",
            log
        ])
    if debug:
        cargs.append("--debug")
    ret = TalairachAviOutputs(
        root=execution.output_file("."),
        output_xfm_file=execution.output_file(output_xfm),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "TALAIRACH_AVI_METADATA",
    "TalairachAviOutputs",
    "talairach_avi",
]
