diff --git a/src/agora/io/cells.py b/src/agora/io/cells.py index 35dfbc5bf208793fc702d89431cd631e5248858d..e72d32f4c13d88272a4962394b408b0a76b47bec 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]]: