cornerstonejs / cornerstone

JavaScript library to display interactive medical images including but not limited to DICOM
https://docs.cornerstonejs.org/
MIT License
2.04k stars 596 forks source link

Rescaling Image on 2 layers #596

Open CredoSpero opened 2 years ago

CredoSpero commented 2 years ago

Hi! I am currently trying to display 2 images in layers onto an element. One is loaded through WADO Loader and the other is loaded through Web Image Loader. However, the images are of different sizes as such I am trying to use the use the cornerstone.rescaleImage(layer1, layer2) function to scale the two images to the same size. However, I am unable to run the function whenever I run the code, it returns cornerstone.rescaleImage is not a function.

I referred to a previous issue https://github.com/cornerstonejs/cornerstone/issues/440, where a user also had faced the same issue. Initially, I thought it could be because the images loaded from WebImageLoader have a spacing of undefined for its columnPixelSpacing and rowPixelSpacing as such, I have tried to add columnPixelSpacing and rowPixelSpacing properties to the image loaded from cornerstoneWebImageLoader in hopes to solve the issue but still, the error still returns that rescaleImage is not a function

Hope you could assist me with this issue as soon as possible as I am currently working on a project. Thank you!