Skip to content

Commit

Permalink
Fix testing get_num_channels
Browse files Browse the repository at this point in the history
Fix arguments for 3D images.
  • Loading branch information
yoda-vid committed Oct 5, 2023
1 parent d96679a commit 57f2ff8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions magmap/tests/test_np_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@
class TestLibmag(unittest.TestCase):

def test_get_num_channels(self):
# test 5D image
img5d = np.zeros((1, 3, 4, 5, 6))
self.assertEqual(np_io.get_num_channels(img5d), 6)

# test 4D+channel image
img5d_no_chl = np.zeros((1, 3, 4, 5))
self.assertEqual(np_io.get_num_channels(img5d_no_chl), 1)

# test 3D+channel image
img3d = np.zeros((3, 4, 5, 6))
self.assertEqual(np_io.get_num_channels(img3d), 6)
self.assertEqual(np_io.get_num_channels(img3d, True), 6)

# test 3D image
img3d_no_chl = np.zeros((3, 4, 5))
self.assertEqual(np_io.get_num_channels(img3d_no_chl), 1)
self.assertEqual(np_io.get_num_channels(img3d_no_chl, True), 1)


if __name__ == "__main__":
Expand Down

0 comments on commit 57f2ff8

Please sign in to comment.