Is there a way to progressively load the images in a volume using cornerstone when the particular slice is opened?

I tried using the cornerstoneStreamingImageVolume to load my volume. It initially creates the volume and then sends out requests for all the ImageIds in the volume one by one. I saw examples that allowed me to customize the order of requests. (cornerstone3D/packages/core/examples/volumePriorityLoading/index.ts at 979c403d57223b2fbf33bf66c48612bb57990c80 · cornerstonejs/cornerstone3D · GitHub)

What I want is for the ImageId request to be triggered when I am viewing that particular slice for the first time on the viewer. Does such a feature already exist?

I want to reduce the memory footprint and hold only those slices which are necessary for showing what is currently on screen
If it doesn’t, How would suggest I go about for adding this feature?

So if you’re actually doing a volume loading it’s not possible because for volume loading it should allocate the memory for the whole volume but if you’re doing a stack viewport it should be possible. So the answer is you can’t really optimize memory footprint for volume although there are two flags that you can try and use.