cornerstonejs / cornerstoneWADOImageLoader

[DEPRECATED] DICOM WADO Image Loader for the cornerstone library
MIT License
283 stars 266 forks source link

bug for version 2.1.2 #204

Closed hu3402379 closed 5 years ago

hu3402379 commented 6 years ago

Hi, I think there is a bug for new version 2.1.2.

When i use cornerstoneWADOImageLoader 2.0.0 version, the default viewport is normal. but when i update to version 2.1.2, some strange things happened.

The core code is as follows:

cornerstone.loadAndCacheImage(imageId).then((image) => { // Get the default viewport if (!viewport) { viewport = cornerstone.getDefaultViewport(element, image) console.log(viewport) } )}

When I first load the image, the viewport is normal, console log like this:

colormap:undefined displayedArea:{tlhc: {…}, brhc: {…}, rowPixelSpacing: 0.486328125, columnPixelSpacing: 0.486328125, presentationSizeMode: "NONE"} hflip:false invert:false labelmap:false modalityLUT:undefined pixelReplication:false rotation:0 scale:NaN translation:{x: 0, y: 0} vflip:false voi:{windowWidth: 1200, windowCenter: -600} voiLUT:undefined

and then I do something(not refresh page), and make it reload the image, the viewport console log like this:

colormap:undefined displayedArea:{tlhc: {…}, brhc: {…}, rowPixelSpacing: 0.486328125, columnPixelSpacing: 0.486328125, presentationSizeMode: "NONE"} hflip:false invert:false labelmap:false modalityLUT:undefined pixelReplication:false rotation:0 scale:NaN translation:{x: 0, y: 0} vflip:false voi:{windowWidth: 1906, windowCenter: 3812} voiLUT:undefined

the defalut ww/wc has been changed.

But if i use cornerstone.loadImage(imageId).then((image), not cornerstone.loadAndCacheImage****, the ww/wc is normal.

I guess this is due to changes in the version upgrade to some code, I have not found a solution。

swederik commented 6 years ago

That's odd.. What are image.windowWidth and image.windowCenter?

hu3402379 commented 6 years ago

@swederik Thanks for your reply. I can not understand what's your mean? Forgive my poor English。。。

swederik commented 6 years ago

Can you give the output of console.log(image) ?

hu3402379 commented 6 years ago

@swederik Hi,first load image console like: Aaron Swartz

and second reload console like: Aaron Swartz

thanks.