OHIF-25: Multi-frame images should be loaded one frame at a time

This commit is contained in:
Leonardo Campos committed 2017-03-15 10:22:14 -03:00
1 parent 6cb0050f38
commit b31d7441ea
6 files changed
+80 -10

No files matched your search

@@ -13,9 +13,16 @@ Template.imageThumbnail.onCreated(() => {
// Get the image ID for current thumbnail
instance.getThumbnailImageId = () => {
const stack = instance.data.thumbnail.stack;
const lastIndex = (stack.images.length || 1) - 1;
const imageIndex = Math.floor(lastIndex / 2) !== 0 ? 0 : 0;
const imageInstance = stack.images[imageIndex];
const lastIndex = (stack.numImageFrames || stack.images.length || 1) - 1;
let imageIndex = Math.floor(lastIndex / 2);
let imageInstance;
if(stack.isMultiFrame) {
imageInstance = stack.images[0];
} else {
imageInstance = stack.images[imageIndex];
imageIndex = 0;
}
return imageInstance.getImageId();
};
@@ -105,7 +105,8 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
// Enable Cornerstone for the viewport element
const options = {
renderer: 'webgl'
// TODO: It's not working with WADO-RS requests (see getWADORSImageId)
// renderer: 'webgl'
};
// NOTE: This uses the experimental WebGL renderer for Cornerstone!