Skip to content
Snippets Groups Projects
Commit 4634eb4e authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Cleaned up image data conform testing

parent 2d3e0e87
No related branches found
No related tags found
No related merge requests found
......@@ -87,10 +87,6 @@ class CziImageFileAccessor(GenericImageFileAccessor):
[0, 1, 2, 3]
)
# try:
# self._data = xycz.reshape(xycz.shape[0:4])
# except Exception:
# raise FileShapeError(f'Cannot handle image with dimensions other than X, Y, C, and Z')
self._data = self.conform_data(xycz.reshape(xycz.shape[0:4]))
def __del__(self):
......
......@@ -33,8 +33,12 @@ class TestCziImageFileAccess(unittest.TestCase):
self.assertEqual(cf.data.shape[3], mono.data.shape[2])
def test_conform_data_shorter_than_xycz(self):
data = np.random.rand(256, 512)
data = np.random.rand(256, 512, 1)
acc = InMemoryDataAccessor(data)
self.assertEqual(
InMemoryDataAccessor.conform_data(data).shape,
(256, 512, 1, 1)
)
self.assertEqual(
acc.shape_dict,
{'X': 256, 'Y': 512, 'C': 1, 'Z': 1}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment