rockverse.voxel_image.VoxelImage.chunk_slice_indices#
- VoxelImage.chunk_slice_indices(chunk_id, return_indices=False)[source]#
Calculate the slice indices for a given Zarr chunk.
This method computes the first and last+1 indices for a specific Zarr chunk within the array, based on the block’s ID. Useful for working with chunked data in parallel processing.
- Parameters:
chunk_id (int) – The ID of the block for which to calculate the slice indices.
- Returns:
If
return_indicesis True, a tuple containing six integers: (box, bex, boy, bey, boz, bez). These represent the start and end indices for the block in the x, y, and z directions, respectively. Ifreturn_indicesis False, a tuple containing the three slices: (slice(box, bex), slice(boy, bey), slice(boz, bez)).- Return type:
tuple