Memory efficient way to read random subvolumes of large 3D datasets on-the-fly #3820
Replies: 3 comments 8 replies
-
there's no ready-to-use solution in monai at the moment, the closest approach would be the coordinate-based patch dataset for digital pathology https://github.com/Project-MONAI/MONAI/blob/dev/monai/apps/pathology/data/datasets.py#L80 |
Beta Was this translation helpful? Give feedback.
-
This would be very interesting, but I think there is no way of achieving this, since there are no readers that can read just a subvolume of a dicom or nii.gz. By the way, |
Beta Was this translation helpful? Give feedback.
-
@perlmutter any luck on this? |
Beta Was this translation helpful? Give feedback.
-
My training data consists of a few dozen large CT volumes, each ~500x2000x2000 voxels. I'd like to train a 3D FCN segmentation model on patches of size ~32x128x128 randomly distributed across all the volumes. One solution would be to simply patchify all the volumes ahead of time, but I'd prefer to randomly sample patches on the fly if possible, via eg.
RandSpatialCropSamples
. However 1) the entire dataset is too large to fit into memory, and 2) it would be very inefficient to read the entire ~500x2000x2000 volume every iteration, only to immediately crop to size 32x128x128 withRandSpatialCropSamples
.Is there any way for the dataloader to load only random subvolumes of the full image? The data can be stored in a zarr or some other chunked data format. If not, is there another method you would suggest?
Beta Was this translation helpful? Give feedback.
All reactions