From c38a363db3ce2df422f273d1845591306f26b3ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Al=C3=A1n=20Mu=C3=B1oz?= <alan.munoz@ed.ac.uk>
Date: Fri, 24 Feb 2023 17:37:34 +0000
Subject: [PATCH] feat(cells): add at_times method

---
 src/agora/io/cells.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/agora/io/cells.py b/src/agora/io/cells.py
index 35dfbc5b..e72d32f4 100644
--- a/src/agora/io/cells.py
+++ b/src/agora/io/cells.py
@@ -162,6 +162,15 @@ class Cells:
         ]
         return self.group_by_traps(traps, masks)
 
+    def at_times(self, timepoints: t.Iterable[int], kind="mask"):
+        return [
+            [
+                np.dstack(tile_masks) if len(tile_masks) else []
+                for tile_masks in self.at_time(tp, kind=kind).values()
+            ]
+            for tp in timepoints
+        ]
+
     def group_by_traps(
         self, traps: t.Collection, cell_labels: t.Collection
     ) -> t.Dict[int, t.List[int]]:
-- 
GitLab