Describe Your Question
I have a dicom file that I am trying to load into a stack viewport. I know my file has 128 frames and I can view them all in a 3rd party software.
Does cornerstone3D support files where x00280008 is set with many frames in that single dcm file?
- Which OHIF version you are using?
@latest
What steps can we follow to reproduce the issue?
- Have a single dicom file that has many frames within it.
- Render with Cornerstone3D api withing a stack.
image_ids = ['server:identifier_for_single_dicom_with_many_frames'];
viewport.setStack(image_ids).then(function(res) {
// debugger;
console.log('res', res);
viewport.render();
});
So, I have been able to paginate the images in the dicom by using ?frame=# in the image_id, but am now running into caching issues.
Promise.allSettled(self.cs.imageLoader.loadAndCacheImages(image_ids)).then(function(promises) {
...
const number_of_frames = +iimage.data.string('x00280008');
if (number_of_frames && number_of_frames > 0) {
processed_image_ids.push(iimage.imageId);
for (let i = 1; i < number_of_frames; i++) {
processed_image_ids.push(iimage.imageId + '?frame=' + i);
}
} else {
processed_image_ids.push(iimage.imageId);
}
I added the initial imageId then looped over the rest in an attempt to trick the cache.
Another update, I was able to pre-load the frames by calling
self.cs.imageLoader.loadAndCacheImages(processed_image_ids.slice(1))
after, but this is slow.
Does anyone have a better solution?