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

import typing
import pathlib
from styxdefs import *
import dataclasses

LTA_DIFF_METADATA = Metadata(
    id="e99c49541b6ef2ad5939381bb81d7249502ffc0c.boutiques",
    name="lta_diff",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def lta_diff(
    transform1: InputPathType,
    transform2: InputPathType | None = None,
    dist_type: int | None = None,
    invert1: bool = False,
    invert2: bool = False,
    vox: bool = False,
    normdiv: float | None = None,
    radius: float | None = None,
    runner: Runner | None = None,
) -> LtaDiffOutputs:
    """
    A tool to compute different distance norms for a single transform or for the
    difference between two transforms.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        transform1: First transform file.
        transform2: Second transform file.
        dist_type: Distance type: 1 (Rigid Trans. Dist.), 2 (Affine Transform\
            Distance), 3 (8-corners mean distance), 4 (Max Displacement), 5\
            (Determinant scaling), 6 (Interpolation Smoothing), 7 (Decomposition).\
            Default is 2.
        invert1: Invert first transform before computing difference matrix D.
        invert2: Invert second transform before computing difference matrix D.
        vox: Compute distance in vox coordinates, after adjusting for voxel\
            sizes. Default is RAS coordinates.
        normdiv: Divide final distance by this value for step adjustment.
        radius: Radius in mm, used for RMS distance. Default is 100 to include\
            the head.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `LtaDiffOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(LTA_DIFF_METADATA)
    cargs = []
    cargs.append("lta_diff")
    cargs.append(execution.input_file(transform1))
    if transform2 is not None:
        cargs.append(execution.input_file(transform2))
    if dist_type is not None:
        cargs.extend([
            "--dist",
            str(dist_type)
        ])
    if invert1:
        cargs.append("--invert1")
    if invert2:
        cargs.append("--invert2")
    if vox:
        cargs.append("--vox")
    if normdiv is not None:
        cargs.extend([
            "--normdiv",
            str(normdiv)
        ])
    if radius is not None:
        cargs.extend([
            "--radius",
            str(radius)
        ])
    ret = LtaDiffOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "LTA_DIFF_METADATA",
    "LtaDiffOutputs",
    "lta_diff",
]
