From e76de5a36ee2008004a92787df8e5573908494db Mon Sep 17 00:00:00 2001
From: Christopher Rhodes <christopher.rhodes@embl.de>
Date: Fri, 27 Oct 2023 11:47:50 +0200
Subject: [PATCH] PatchStackObjectClassifier now returns a valid MonoPatchStack

---
 extensions/chaeo/models.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/extensions/chaeo/models.py b/extensions/chaeo/models.py
index 5900134e..8a141b35 100644
--- a/extensions/chaeo/models.py
+++ b/extensions/chaeo/models.py
@@ -33,11 +33,12 @@ class PatchStackObjectClassifier(IlastikObjectClassifierFromSegmentationModel):
 
         # for some reason ilastik scrambles these axes to Z(1)YX(1)
         assert obmaps[0].shape == (input_acc.nz, 1, input_acc.hw[0], input_acc.hw[1], 1)
-        yxcz = np.moveaxis(
-            obmaps[0][:, :, :, :, 0],
-            [2, 3, 1, 0],
-            [0, 1, 2, 3]
+        yxz = np.moveaxis(
+            obmaps[0][:, 0, :, :, 0],
+            [1, 2, 0],
+            [0, 1, 2]
         )
 
-        assert yxcz.shape == input_acc.shape
-        return InMemoryDataAccessor(data=yxcz), {'success': True}
\ No newline at end of file
+        assert yxz.shape[0:2] == input_acc.hw
+        assert yxz.shape[2] == input_acc.nz
+        return MonoPatchStack(data=yxz), {'success': True}
\ No newline at end of file
-- 
GitLab