Open hpawe01 opened 1 year ago
In a multi layer setup only the images of the first stack are prefetched. If you have multiple layers, e.g. 1. the actual image and 2. an overlay, and scroll through the stack, you will notice a delay for the overlay part.
In the code you also see that only the first stack is used for the prefetch operation: https://github.com/cornerstonejs/cornerstoneTools/blob/master/src/stackTools/stackPrefetch.js#L77
// 1. add stack manager cornerstoneTools.addStackStateManager(element, ['stack']); // 2. add stacks cornerstoneTools.addToolState(element, 'stack', stack1) cornerstoneTools.addToolState(element, 'stack', stack2) // 3. configure fusion renderer const renderer = new cornerstoneTools.stackRenderers.FusionRenderer(); cornerstoneTools.addToolState(element, 'stackRenderer', renderer); renderer.currentImageIdIndex = stack1.currentImageIdIndex renderer.findImageFn = (imageIds, targetImageId) => { const targetImageIndex = stack1.imageIds.indexOf(targetImageId) return imageIds[targetImageIndex]; } renderer.render(element); // 4. prefetch stack cornerstoneTools.stackPrefetch.setConfiguration({ 'maxSimultaneousRequests': 8, 'preserveExistingPool': true }); cornerstoneTools.stackPrefetch.enable(element);
Expected behavior: stackPrefetch.enable() should prefetch images for all stacks
stackPrefetch.enable()
Actual behavior: stackPrefetch.enable() prefetches images only for the first stack
Sorry, I don't have that kind of dummy stack data public available.
Prerequisites
Description
In a multi layer setup only the images of the first stack are prefetched. If you have multiple layers, e.g. 1. the actual image and 2. an overlay, and scroll through the stack, you will notice a delay for the overlay part.
In the code you also see that only the first stack is used for the prefetch operation: https://github.com/cornerstonejs/cornerstoneTools/blob/master/src/stackTools/stackPrefetch.js#L77
Steps to Reproduce the issue
Expected behavior:
stackPrefetch.enable()
should prefetch images for all stacksActual behavior:
stackPrefetch.enable()
prefetches images only for the first stackCodeSandbox With Reproduction of Issue:
Sorry, I don't have that kind of dummy stack data public available.