-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
853f40f
commit 2479961
Showing
5 changed files
with
82 additions
and
15 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
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
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,20 @@ | ||
class TestRoi: | ||
def test_roi_conversion(self) -> None: | ||
"""Test the conversion between world and raster coordinates.""" | ||
from ngio.core.roi import Dimensions, PixelSize, RasterCooROI, WorldCooROI | ||
|
||
w_roi = WorldCooROI(x=0, y=0, z=0, x_length=10, y_length=10, z_length=10) | ||
|
||
dim = Dimensions( | ||
on_disk_shape=(10, 10, 10), axes_names=["z", "y", "x"], axes_order=[0, 1, 2] | ||
) | ||
|
||
r_roi = w_roi.to_raster_coo(PixelSize(x=0.1, y=0.1, z=0.1), dim) | ||
|
||
assert (r_roi.x, r_roi.y, r_roi.z) == (0, 0, 0) | ||
|
||
r_roi_2 = RasterCooROI( | ||
x=0, y=0, z=0, x_length=10, y_length=10, z_length=10, original_roi=w_roi | ||
) | ||
|
||
assert r_roi_2.model_dump() == r_roi.model_dump() |