-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils to turn all transformations to affine
- Loading branch information
1 parent
a8ee22b
commit 206e3fe
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from spatialdata.transformations._utils import convert_transformations_to_affine | ||
from spatialdata.transformations.operations import get_transformation, set_transformation | ||
from spatialdata.transformations.transformations import Affine, Scale, Sequence, Translation | ||
|
||
|
||
def test_convert_transformations_to_affine(full_sdata): | ||
translation = Translation([1, 2, 3], axes=("x", "y", "z")) | ||
scale = Scale([1, 2, 3], axes=("x", "y", "z")) | ||
sequence = Sequence([translation, scale]) | ||
for _, _, element in full_sdata.gen_spatial_elements(): | ||
set_transformation(element, transformation=sequence, to_coordinate_system="test") | ||
convert_transformations_to_affine(full_sdata, "test") | ||
for _, _, element in full_sdata.gen_spatial_elements(): | ||
t = get_transformation(element, "test") | ||
assert isinstance(t, Affine) |