Hi,
cornerstone comes with a lot of good examples and I like it. :)
Using
as a model, I'm writing a four image page. When the four wwwc are not synced and the four images are not the same one, it's fine. When they are synced and the four images are not the same one, wwwc is very slow.
I'm not sure about the reason of this behaviour. I suppose I didn't write a correct "stack" or the like. I understand that stack is a way to manage array of images but I didn't understand it very well (I know there is CornerDemo but it is a large example to study). Do you have a small stack example? All the examples of cornerstone (except the large "demo") are for a fixed number of images... the code is AFAIK always a cut/paste/change of the form something(element_number, function) but when I try to compact the example in an array (for example, the 3 images example of
for example, repeating the following block for four images is fine (data comes from ajax, for example)
cornerstone.loadImage(dicomPrefix + data[0]).then(function (image) {
cornerstone.displayImage(dcms[0], image);
_myPrivateSetup(dcmsDom[0], dcms[0]);
});
/* the same block repeated for [1], [2] etc... */
but when I try to put the four block in a trivial foreach like
for (var i = 0; i < data.length; i++) {
cornerstone.loadImage(dicomPrefix + data[i]).then(function (image) {
cornerstone.displayImage(dcms[i], image);
toolsSetup(dcmsDom[i], dcms[i]);
});
}
it stops with
Uncaught displayImage: parameter element cannot be undefined
Thanks.