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

import typing
import pathlib
from styxdefs import *
import dataclasses

LTA_CONVERT_METADATA = Metadata(
    id="daaa6767af53c23e0e3f62c31924d12dbc6e0eaa.boutiques",
    name="lta_convert",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class LtaConvertOutputs(typing.NamedTuple):
    """
    Output object returned when calling `lta_convert(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_transform_file: OutputPathType | None
    """Output transformed file."""


def lta_convert(
    in_vox: InputPathType | None = None,
    out_vox: str | None = None,
    invert: bool = False,
    ltavox2vox: bool = False,
    ltatkreg: bool = False,
    src_geometry: InputPathType | None = None,
    trg_geometry: InputPathType | None = None,
    trg_conform: bool = False,
    subject_name: str | None = None,
    runner: Runner | None = None,
) -> LtaConvertOutputs:
    """
    This program converts between different linear transform formats.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        in_vox: Input transform in source image space (inverse VOX2VOX).
        out_vox: Output transform in source image space (inverse VOX2VOX).
        invert: Inverts transform.
        ltavox2vox: Output type VOX2VOX (default RAS2RAS) with --ltaout.
        ltatkreg: Output type REGISTER_DAT (default RAS2RAS) with --ltaout.
        src_geometry: Specify src image geometry (mov volume for\
            TKREG/register.dat).
        trg_geometry: Specify trg image geometry.
        trg_conform: Conform trg image geometry (COR standard).
        subject_name: Specify subject name (overrides if input has subject name\
            defined).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LtaConvertOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LTA_CONVERT_METADATA)
    cargs = []
    cargs.append("lta_convert")
    if in_vox is not None:
        cargs.extend([
            "--invox",
            execution.input_file(in_vox)
        ])
    if out_vox is not None:
        cargs.extend([
            "--outvox",
            out_vox
        ])
    if invert:
        cargs.append("--invert")
    if ltavox2vox:
        cargs.append("--ltavox2vox")
    if ltatkreg:
        cargs.append("--ltatkreg")
    if src_geometry is not None:
        cargs.extend([
            "--src",
            execution.input_file(src_geometry)
        ])
    if trg_geometry is not None:
        cargs.extend([
            "--trg",
            execution.input_file(trg_geometry)
        ])
    if trg_conform:
        cargs.append("--trgconform")
    if subject_name is not None:
        cargs.extend([
            "--subject",
            subject_name
        ])
    ret = LtaConvertOutputs(
        root=execution.output_file("."),
        output_transform_file=execution.output_file(out_vox) if (out_vox is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LTA_CONVERT_METADATA",
    "LtaConvertOutputs",
    "lta_convert",
]
