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

import typing
import pathlib
from styxdefs import *
import dataclasses

IMROTATE_METADATA = Metadata(
    id="91ce2622ebf37f0ee8816748397e7f0cf65a832b.boutiques",
    name="imrotate",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class ImrotateOutputs(typing.NamedTuple):
    """
    Output object returned when calling `imrotate(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_image_file: OutputPathType
    """Path to the output image file"""


def imrotate(
    dx: float,
    dy: float,
    phi: float,
    input_image: InputPathType,
    output_image: InputPathType,
    fourier_interpolation: bool = False,
    runner: Runner | None = None,
) -> ImrotateOutputs:
    """
    Shifts and rotates an image.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        dx: Pixels to shift rightwards (can be non-integer).
        dy: Pixels to shift downwards (can be non-integer).
        phi: Degrees to rotate clockwise.
        input_image: Input image file.
        output_image: Output image file.
        fourier_interpolation: Use Fourier interpolation.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ImrotateOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(IMROTATE_METADATA)
    cargs = []
    cargs.append("imrotate")
    if fourier_interpolation:
        cargs.append("-Fourier")
    cargs.append(str(dx))
    cargs.append(str(dy))
    cargs.append(str(phi))
    cargs.append(execution.input_file(input_image))
    cargs.append(execution.input_file(output_image))
    ret = ImrotateOutputs(
        root=execution.output_file("."),
        output_image_file=execution.output_file(pathlib.Path(output_image).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "IMROTATE_METADATA",
    "ImrotateOutputs",
    "imrotate",
]
