Пример #1
0
 def _get_tile(self, tile: Interval5D) -> Array5D:
     if self.location != self.scale.voxel_offset:
         tile = tile.translated(-self.location).translated(
             self.scale.location)
     tile_path = self.path / self.scale.get_tile_path(tile)
     with self.filesystem.openbin(tile_path.as_posix()) as f:
         raw_tile_bytes = f.read()
     tile_5d = self.scale.encoding.decode(
         roi=tile, dtype=self.dtype,
         raw_chunk=raw_tile_bytes)  #type: ignore
     return tile_5d
Пример #2
0
 def _get_tile(self, tile: Interval5D) -> Array5D:
     slices = tile.translated(-self.location).to_slices(self.axiskeys)
     raw: np.ndarray = self._dataset[slices]
     return Array5D(raw, axiskeys=self.axiskeys, location=tile.start)