Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackPrefetch fetches only first layer #1554

Open
3 tasks done
hpawe01 opened this issue Aug 28, 2023 · 0 comments
Open
3 tasks done

StackPrefetch fetches only first layer #1554

hpawe01 opened this issue Aug 28, 2023 · 0 comments

Comments

@hpawe01
Copy link

hpawe01 commented Aug 28, 2023

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

// 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

Actual behavior: stackPrefetch.enable() prefetches images only for the first stack

CodeSandbox With Reproduction of Issue:

Sorry, I don't have that kind of dummy stack data public available.

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

No branches or pull requests

1 participant