diff --git a/README.md b/README.md index 6d330a9d62b01a8c9bad96bf2ff156ac3ac44202..fac23288c4ae2daba92b8a9a7910b346be368796 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Alternatively, if you want to get all the traps at a given timepoint: ```python timepoint = 0 -seg_expt.get_traps_timepoints(timepoint, tile_size=96, channels=None, +seg_expt.get_tiles_timepoints(timepoint, tile_size=96, channels=None, z=[0,1,2,3,4]) ``` diff --git a/aliby/tile/tiler.py b/aliby/tile/tiler.py index 80402541bca529dbdc014021026b70ea024981cc..2740022a0623e2c0025334240e22107162d70f30 100644 --- a/aliby/tile/tiler.py +++ b/aliby/tile/tiler.py @@ -488,8 +488,16 @@ class Tiler(ProcessABC): self.run_tp(frame) return None + def get_traps_timepoint(self, *args, **kwargs): + # + print( + DeprecationWarning("Deprecated:Use get_tiles_timepoint instead.") + ) + + return self.get_tiles_timepoint(*args, **kwargs) + # The next set of functions are necessary for the extraction object - def get_traps_timepoint( + def get_tiles_timepoint( self, tp, tile_shape=None, channels=None, z=None ) -> np.ndarray: """ diff --git a/aliby/utils/imageViewer.py b/aliby/utils/imageViewer.py index d53b4f0e0b3a3dde4d06320dc5fa4baf559a33e1..674908128d1027fdc3ff9945a5e4f7e2c03ac388 100644 --- a/aliby/utils/imageViewer.py +++ b/aliby/utils/imageViewer.py @@ -197,7 +197,7 @@ class remoteImageViewer: # tps = set(tps).difference(self.full.keys()) for ch, tp in ch_tps: if (ch, tp) not in self.full: - self.full[(ch, tp)] = self.tiler.get_traps_timepoint( + self.full[(ch, tp)] = self.tiler.get_tiles_timepoint( tp, channels=[ch], z=[z] )[:, 0, 0, ..., z] requested_trap = {tp: self.full[(ch, tp)] for ch, tp in ch_tps} diff --git a/extraction/core/extractor.py b/extraction/core/extractor.py index ee7e58b61ecba102672844bf4bd377ad6c0a00d8..b588678276f555df62738c65e2ce41fb35477a2c 100644 --- a/extraction/core/extractor.py +++ b/extraction/core/extractor.py @@ -256,7 +256,7 @@ class Extractor(ProcessABC): z = list(range(self.tiler.shape[-1])) # gets the data via tiler traps = ( - self.tiler.get_traps_timepoint( + self.tiler.get_tiles_timepoint( tp, channels=channel_ids, z=z, **kwargs ) if channel_ids @@ -294,7 +294,8 @@ class Extractor(ProcessABC): A two-tuple of a tuple of results and a tuple with the corresponding trap_id and cell labels """ if labels is None: - raise Warning("No labels given. Sorting cells using index.") + print("Warning: No labels given. Sorting cells using index.") + cell_fun = True if metric in self._all_cell_funs else False idx = [] results = [] @@ -471,7 +472,7 @@ class Extractor(ProcessABC): # find image data at the time point # stored as an array arranged as (traps, channels, timepoints, X, Y, Z) # Alan: traps does not appear the best name here! - traps = self.get_traps(tp, tile_shape=tile_size, channels=tree_chs) + traps = self.get_tiles(tp, tile_shape=tile_size, channels=tree_chs) # generate boolean masks for background as a list with one mask per trap if self.params.sub_bg: