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

Added PCZYX getter mainly for ilastik use

parent d992c9d2
No related branches found
No related tags found
No related merge requests found
......@@ -127,11 +127,18 @@ class PatchStack(InMemoryDataAccessor):
@property
def pyxcz(self):
return self._data
return self.data
@property
def pczyx(self):
return np.moveaxis(
self.data,
[0, 3, 4, 1, 2],
[0, 1, 2, 3, 4]
)
@property
def shape(self):
return self._data.shape
return self.data.shape
@property
def shape_dict(self):
......
......@@ -61,4 +61,15 @@ class TestMultipositionCziImageFileAccess(unittest.TestCase):
self.assertEqual(acc.hw, (h, 2 * w))
self.assertEqual(acc.chroma, c)
self.assertEqual(acc.iat(0).shape, (h, 2 * w, c, nz))
self.assertEqual(acc.iat_yxcz(0).shape, (h, 2 * w, c, nz))
\ No newline at end of file
self.assertEqual(acc.iat_yxcz(0).shape, (h, 2 * w, c, nz))
def test_pczyx(self):
w = 256
h = 512
n = 4
nz = 15
nc = 2
acc = PatchStack(np.random.rand(n, h, w, nc, nz))
self.assertEqual(acc.count, n)
self.assertEqual(acc.pczyx.shape, (n, nc, nz, h, w))
self.assertEqual(acc.hw, (h, w))
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