예제 #1
0
 def process(self,
             roi: Slice5D = Slice5D.all(),
             address_mode: AddressMode = AddressMode.BLACK) -> None:
     defined_roi = roi.defined_with(self.data_slice)
     assert self.data_slice.contains(defined_roi)
     for piece in defined_roi.split(self.tile_shape):
         source_data = self.data_slice.datasource.retrieve(
             piece, address_mode=address_mode)
         self._process_tile(source_data)
예제 #2
0
 def retrieve(self, roi: Slice5D, address_mode: AddressMode = AddressMode.BLACK) -> Array5D:
     # FIXME: Remove address_mode or implement all variations and make feature extractors use the correct one
     out = self._allocate(roi.defined_with(self.shape).translated(-self.location), fill_value=0)
     local_data_roi = roi.clamped(self.roi).translated(-self.location)
     for tile in local_data_roi.get_tiles(self.tile_shape):
         tile_within_bounds = tile.clamped(self.shape)
         tile_data = self.get_tile(tile_within_bounds)
         out.set(tile_data, autocrop=True)
     out.setflags(write=False)
     return out.translated(self.location)
예제 #3
0
 def contains(self, slc: Slice5D) -> bool:
     return super().contains(slc.defined_with(self.full_shape))