Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/spatialdata/transformations/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ def _get_default_coordinate_system(

@abstractmethod
def inverse(self) -> BaseTransformation:
"""
Return the inverse of the transformation.

Returns
-------
BaseTransformation
A new transformation that is the inverse of this one, such that applying
both in sequence yields the identity transformation.
"""
pass

# @abstractmethod
Expand All @@ -118,6 +127,22 @@ def inverse(self) -> BaseTransformation:

@abstractmethod
def to_affine_matrix(self, input_axes: tuple[ValidAxis_t, ...], output_axes: tuple[ValidAxis_t, ...]) -> ArrayLike:
"""
Return the affine matrix representation of the transformation.

Parameters
----------
input_axes
The axes of the input coordinate system, e.g. ``("x", "y")`` or ``("x", "y", "z")``.
output_axes
The axes of the output coordinate system.

Returns
-------
ArrayLike
A homogeneous affine matrix of shape ``(len(output_axes) + 1, len(input_axes) + 1)``.
The last row is always ``[0, 0, ..., 1]``.
"""
pass

def to_affine(self, input_axes: tuple[ValidAxis_t, ...], output_axes: tuple[ValidAxis_t, ...]) -> Affine:
Expand Down