Skip to content

Commit

Permalink
added double depth slice test
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Sep 23, 2024
1 parent e1a6332 commit 9d256fe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_volumetricimagingextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,17 @@ def test_depth_slice(volumetric_imaging_extractor, start_plane, end_plane):
def test_depth_slice_invalid(volumetric_imaging_extractor, start_plane, end_plane):
with pytest.raises(AssertionError):
volumetric_imaging_extractor.depth_slice(start_plane=start_plane, end_plane=end_plane)


def test_depth_slice_twice(volumetric_imaging_extractor):
sliced_extractor = volumetric_imaging_extractor.depth_slice(start_plane=0, end_plane=2)
twice_sliced_extractor = sliced_extractor.depth_slice(start_plane=0, end_plane=1)

assert twice_sliced_extractor.get_num_planes() == 1
assert twice_sliced_extractor.get_image_size() == (*volumetric_imaging_extractor.get_image_size()[:2], 1)
video = volumetric_imaging_extractor.get_video()
sliced_video = twice_sliced_extractor.get_video()
assert np.all(video[..., :1] == sliced_video)
frames = volumetric_imaging_extractor.get_frames(frame_idxs=[0, 1, 2])
sliced_frames = twice_sliced_extractor.get_frames(frame_idxs=[0, 1, 2])
assert np.all(frames[..., :1] == sliced_frames)

0 comments on commit 9d256fe

Please sign in to comment.