diff --git a/src/spatialdata/transformations/transformations.py b/src/spatialdata/transformations/transformations.py index deace0ae1..46e12afab 100644 --- a/src/spatialdata/transformations/transformations.py +++ b/src/spatialdata/transformations/transformations.py @@ -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 @@ -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: