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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3DMAXDISP_METADATA = Metadata(
    id="8e31f05fbdb7f51731c9b9e8013c472695fe9543.boutiques",
    name="3dmaxdisp",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dmaxdispOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3dmaxdisp(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    displacement_output: OutputPathType
    """Results showing average and maximum displacements."""


def v_3dmaxdisp(
    inset: InputPathType,
    matrix: InputPathType,
    verbose: bool = False,
    runner: Runner | None = None,
) -> V3dmaxdispOutputs:
    """
    Reads in a 3D dataset and a DICOM-based affine matrix to output the average and
    maximum displacement applied to the edge voxels of the 3D dataset's automask.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        inset: Input dataset file used to form the mask over which\
            displacements will be computed.
        matrix: 3x4 affine transformation matrix file applied to the\
            coordinates of the voxels in the dataset mask.
        verbose: Print a few progress reports.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dmaxdispOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3DMAXDISP_METADATA)
    cargs = []
    cargs.append("3dmaxdisp")
    cargs.extend([
        "-inset",
        execution.input_file(inset)
    ])
    cargs.extend([
        "-matrix",
        execution.input_file(matrix)
    ])
    if verbose:
        cargs.append("-verb")
    ret = V3dmaxdispOutputs(
        root=execution.output_file("."),
        displacement_output=execution.output_file("stdout"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dmaxdispOutputs",
    "V_3DMAXDISP_METADATA",
    "v_3dmaxdisp",
]
