cornerstonejs / cornerstone3D

Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer.
https://cornerstonejs.org
MIT License
492 stars 256 forks source link

[Bug] Gray lines in volume reconstruction #639

Open mauricio-cdr opened 1 year ago

mauricio-cdr commented 1 year ago

Describe the Bug

Hello I hope you are well.

There is an error that appears when trying to do a multiplanar reconstruction with several images ( 300 +). Some images are not displayed on the AXIAL view and gray lines appear in SAGITTAL, CORONAL

Captura de Pantalla 2023-06-02 a la(s) 17 56 53

In each refresh of the page the missing images are different, even sometimes all the images are loaded correctly and when viewing the request in the browser inspector the following is shown.

Captura de Pantalla 2023-06-02 a la(s) 18 01 23

Although the request has status 200 it appears that the request has not been completed. This could be a browser problem with the number of simultaneous request.


So, We try change the number of maximum simultaneous requests and the problem disappears

  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Interaction, 10);
  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Thumbnail, 10);
  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Prefetch, 10);

but it seems that the image prefetch made by the streaming-volume-loader is no longer fully respected because although I see in the network inspector that if the request for the middle image was made before the others, it is not displayed until that its index is reached.

Captura de Pantalla 2023-06-02 a la(s) 18 36 19

Steps to Reproduce

  1. You can use the example of crosshairs packages/tools/examples/crossHairs/index.ts
  2. Set max simultaneous request to 1 or any value < totalimages/2
  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Interaction, 1);
  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Thumbnail, 1);
  imageLoadPoolManager.setMaxSimultaneousRequests(RequestType.Prefetch, 1);

The current behavior

With limit of max simultaneous request (But in the end if it finishes loading all)

Captura de Pantalla 2023-06-02 a la(s) 18 36 19

Without limit of max simultaneous request (but it does not load all the images)

Captura de Pantalla 2023-06-02 a la(s) 18 47 43

The expected behavior

Show all images starting for the middle image

Captura de Pantalla 2023-06-02 a la(s) 18 48 29

OS

macOs12.3 , Windows 10, Linux Mint

Node version

18.13.0

Browser

Chrome 90+

longuto commented 1 year ago

@mauricio-cdr I also experienced this situation, i used wadouri in volume render. Have you solved this problem yet

sedghi commented 1 year ago

I have seen this before, but when I have the chrome devtools opened, I haven't seen it when it is closed though. What is your server? are you using dicomweb? are you using orthanc/dcm4chee? can you share the deidentified data?

sedghi commented 1 year ago

I'm trying to replicate this or at least find a minimum number of steps to reproduce this constantly, no luck so far. Do you have reproducible steps? I tried orthanc too, throttled network and cpu, still loads fine

zhoualibaba commented 1 year ago

This problem occurs frequently with me. When I load using CPU or use Edge, the gray line disappears .I guess this is related to using GPU for data loading. When I open devtools, I can see that a certain dicom data loading is abnormal. 6876573165073

sumilying commented 1 year ago

I also encountered this problem. But the positions that appear are random, and when positioned on the gray line, the axial display is also abnormal。 1 2 3

sedghi commented 1 year ago

So we don't want to have CPU rendering on, since there is no volume viewport for CPU. I can spend time on this to be able to fix it, but at least I need some reproducible steps. Is this dicom web? what dicom web server you are using, can you create a repo and share it with me with bare minimum? (you can share private if you want)

sumilying commented 11 months ago

So we don't want to have CPU rendering on, since there is no volume viewport for CPU. I can spend time on this to be able to fix it, but at least I need some reproducible steps. Is this dicom web? what dicom web server you are using, can you create a repo and share it with me with bare minimum? (you can share private if you want)

I did not use dicom web server. I finailly find the promblem ,But i do not think I get the best solution for it . all the imageUrl will be send when call the volumeLoader.createAndCacheVolume(volumeId, { imageIds, }); this will triagger the xhrRequest of dicomImageLoader. you can see all the request is sucessfully call the function of xhr.onloadstart.but not all of them will call the function of xhr.onloadend. and both the gray line is these(URL request) which do not arrive onloadend . the solution of mine(But it seem like stupid). first i set a timeout for the request, and add a function xhr.timeout ,when timeout ,the function of ontimeout will be called ,and recored these requests. then send these requests again and get the response successfully and send info to the main thread there is some other image is already for load(by postmessage).when the main thread get this message , call the volumeLoader.createAndCacheVolume(volumeId, { imageIds, }); again . will get the successful diaplay or rebuild of MPR slice

sedghi commented 11 months ago

if you found the issue that is great. if you create a mini repo with the issue showing i can certainly look at it