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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_ROTATE_METADATA = Metadata(
    id="ef8f8112c666b20f57f67d98677ecae66ab493de.boutiques",
    name="mris_rotate",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisRotateOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_rotate(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    rotated_surface: OutputPathType
    """The rotated output surface."""


def mris_rotate(
    input_surface: InputPathType,
    alpha_deg: float,
    beta_deg: float,
    gamma_deg: float,
    output_surface: str,
    regfile: InputPathType | None = None,
    invalidate_geometry: bool = False,
    runner: Runner | None = None,
) -> MrisRotateOutputs:
    """
    Rotate a surface given three angles.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file to be rotated.
        alpha_deg: Rotation angle in degrees around the X-axis.
        beta_deg: Rotation angle in degrees around the Y-axis.
        gamma_deg: Rotation angle in degrees around the Z-axis.
        output_surface: Output surface file after rotation.
        regfile: Extract angles from registration file, ignores alpha, beta,\
            gamma.
        invalidate_geometry: Invalidate volume geometry in output.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisRotateOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_ROTATE_METADATA)
    cargs = []
    cargs.append("mris_rotate")
    cargs.append(execution.input_file(input_surface))
    cargs.append(str(alpha_deg))
    cargs.append(str(beta_deg))
    cargs.append(str(gamma_deg))
    cargs.append(output_surface)
    if regfile is not None:
        cargs.extend([
            "-r",
            execution.input_file(regfile)
        ])
    if invalidate_geometry:
        cargs.append("-n")
    ret = MrisRotateOutputs(
        root=execution.output_file("."),
        rotated_surface=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_ROTATE_METADATA",
    "MrisRotateOutputs",
    "mris_rotate",
]
