def _get_tile(self, tile: Slice5D) -> Array5D: slice_address = "_".join( f"{s.start}-{s.stop}" for s in tile.to_slices(self.scale.spatial_axiskeys)) path = self.scale.key + "/" + slice_address with self.filesystem.openbin(path) as f: raw_tile_bytes = f.read() raw_tile_c_shape = tile.shape.to_tuple(self.axiskeys) raw_tile = np.frombuffer(raw_tile_bytes, dtype=self.dtype).reshape(raw_tile_c_shape) tile_5d = Array5D(raw_tile, axiskeys=self.axiskeys) return tile_5d.translated(tile.start)
def process_tile(tile: Slice5D, rank: int): self.set_roi(tile) slices = tile.to_slices(output_meta.getAxisKeys()) with z5py.File(n5_file_path, "r+") as n5_file: dataset = n5_file[self.OutputInternalPath.value] dataset[slices] = self.ImageToExport.value
def _get_tile(self, tile: Slice5D) -> Array5D: slices = tile.to_slices(self.axiskeys) raw = cast(h5py.Dataset, self._dataset)[slices] return Array5D(raw, axiskeys=self.axiskeys, location=tile.start)