-
Notifications
You must be signed in to change notification settings - Fork 4
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
9990f78
commit b770b32
Showing
2 changed files
with
29 additions
and
29 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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#filename and function name should start with "test_" when using pytest | ||
import pyclesperanto_prototype as cle | ||
import numpy as np | ||
from lls_core.models.lattice_data import LatticeData | ||
from xarray import DataArray | ||
import tempfile | ||
|
||
def test_deskew(): | ||
|
||
raw = np.zeros((5,5,5)) | ||
raw[2,0,0] = 10 | ||
|
||
deskewed = cle.deskew_y(raw,angle_in_degrees=60) | ||
|
||
#np.argwhere(deskewed>0) | ||
assert deskewed.shape == (4,8,5) | ||
assert deskewed[2,2,0] == 0.5662433505058289 | ||
|
||
def test_lattice_data_deskew(): | ||
raw = DataArray(np.zeros((5, 5, 5)), dims=["X", "Y", "Z"]) | ||
with tempfile.TemporaryDirectory() as tmpdir: | ||
lattice = LatticeData( | ||
input_image=raw, | ||
physical_pixel_sizes = (1, 1, 1), | ||
save_name="test", | ||
save_dir=tmpdir | ||
) | ||
assert lattice.deskew_vol_shape == [2, 9, 5] | ||
#filename and function name should start with "test_" when using pytest | ||
import pyclesperanto_prototype as cle | ||
import numpy as np | ||
from lls_core.models.lattice_data import LatticeData | ||
from xarray import DataArray | ||
import tempfile | ||
|
||
def test_deskew(): | ||
|
||
raw = np.zeros((5,5,5)) | ||
raw[2,0,0] = 10 | ||
|
||
deskewed = cle.deskew_y(raw,angle_in_degrees=60) | ||
|
||
#np.argwhere(deskewed>0) | ||
assert deskewed.shape == (4,8,5) | ||
assert deskewed[2,2,0] == 0.5662433505058289 | ||
|
||
def test_lattice_data_deskew(): | ||
raw = DataArray(np.zeros((5, 5, 5)), dims=["X", "Y", "Z"]) | ||
with tempfile.TemporaryDirectory() as tmpdir: | ||
lattice = LatticeData( | ||
input_image=raw, | ||
physical_pixel_sizes = (1, 1, 1), | ||
save_name="test", | ||
save_dir=tmpdir | ||
) | ||
assert lattice.derived.deskew_vol_shape == (2, 9, 5) |