Skip to content

Conversation

@pr4deepr
Copy link
Collaborator

@pr4deepr pr4deepr commented Apr 30, 2025

This PR will deal with tiling large datasets.
Addresses #105.

When deskewing data in GPU, the deskewed image is converted to a 32-bit image. This results in increased GPU memory usage. This could potentially crash the software if:

  • images are large in size
  • GPU memory is small

To get around this, dividing the image into tiles and processing each image would be the best strategy. We already have a function for deskewing cropped images, so this can be reused here.

Strategy

  • Estimate max allocated image memory for GPU (max_gpu_mem).
  • Tiling strategy:
    • Get shape and size of a single deskewed image output
    • Create a dask image with same size and dtype (float32)
    • Divide into tiles, where each tile is less than max_gpu_mem. May add some padding of 5 - 10 px. Use dask rechunk and overlap?
    • Get the bounding box coordinates of each block (index of blocks and coords)
    • use crop_vol_deskew function to deskew each block where we pass the original image and roi coordinates in deskewed image space. Added bonus is that it accounts for deconvolution as well
    • Pass the cropped output into corresponding coordinates in the dask image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants