slim: Improve client-side error handling

The interface shows for a bit and then the browser goes blank.

https://viewer.imaging.datacommons.cancer.gov/slim/studies/2.25.174442227011591161839224535127252003551/series/1.3.6.1.4.1.5962.99.1.2352175091.700331458.1655914616819.4.0

This message shows up in the developer console:

react-dom.production.min.js:189 Error: Pyramid of optical path "1" is different from reference pyramid.
    at O (viewer.js:1033:17)
    at new e (viewer.js:948:71)
    at ke (SlideViewer.tsx:111:24)
    at new n (SlideViewer.tsx:433:43)
    at Ba (react-dom.production.min.js:147:172)
    at Nu (react-dom.production.min.js:198:97)
    at xi (react-dom.production.min.js:292:172)
    at bs (react-dom.production.min.js:280:389)
    at gs (react-dom.production.min.js:280:320)
    at vs (react-dom.production.min.js:280:180)

Desired behavior would be at least an error message to the user and graceful handling. Even better would be to handle this kind of data (although that may not be possible if the data is invalid for some reason).

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Thank you @hackermd and @Punzo - let’s wait to hear from David. To me, it makes sense to add some logic to the converter to detect this kind of issues at the time of conversion.

@fedorov I have started to work on improving the error handling. As stated above, the viewer should definitely handle such errors more gracefully. Providing a meaningful error message to the user that contains the right level of detail will require some thought and development work.

To fix the underlying issue, we will also need to investigate the data, because the issue is most likely due to a problem with the data rather than a bug in the viewer. The viewer requires pyramids of different channels to have the same structure. That does not seem to be the case here.

Image with Optical Path Identifier "1":

=== Pyramid Level 0 ===
Total Pixel Matrix Rows/Columns: (29226, 33635)
Pixel Spacing: (0.000649983750406, 0.000649983750406)
Downsampling Factors: (1.0, 1.0)
=== Pyramid Level 1 ===
Total Pixel Matrix Rows/Columns: (14613, 16818)
Pixel Spacing: (0.001299928852712, 0.001299928852712)
Downsampling Factors: (2.0, 1.9999405398977286)
=== Pyramid Level 2 ===
Total Pixel Matrix Rows/Columns: (7307, 8409)
Pixel Spacing: (0.002599857705424, 0.002599857705424)
Downsampling Factors: (3.9997262898590393, 3.999881079795457)
=== Pyramid Level 3 ===
Total Pixel Matrix Rows/Columns: (3654, 4205)
Pixel Spacing: (0.005199097133154, 0.005199097133154)
Downsampling Factors: (7.998357963875205, 7.998810939357908)
=== Pyramid Level 4 ===
Total Pixel Matrix Rows/Columns: (1827, 2103)
Pixel Spacing: (0.010395722037524, 0.010395722037524)
Downsampling Factors: (15.99671592775041, 15.993818354731337)
=== Pyramid Level 5 ===
Total Pixel Matrix Rows/Columns: (914, 1052)
Pixel Spacing: (0.020781562209994, 0.020781562209994)
Downsampling Factors: (31.975929978118163, 31.972433460076047)
=== Pyramid Level 6 ===
Total Pixel Matrix Rows/Columns: (457, 526)
Pixel Spacing: (0.041563124419988, 0.041563124419988)
Downsampling Factors: (63.951859956236326, 63.944866920152094)

Image with Optical Path Identifier "0":

=== Pyramid Level 0 ===
Total Pixel Matrix Rows/Columns: (29226, 33635)
Pixel Spacing: (0.000649999976158, 0.000649999976158)
Downsampling Factors: (1.0, 1.0)
=== Pyramid Level 1 ===
Total Pixel Matrix Rows/Columns: (14613, 16818)
Pixel Spacing: (0.001299961303251, 0.001299961303251)
Downsampling Factors: (2.0, 1.9999405398977286)
=== Pyramid Level 2 ===
Total Pixel Matrix Rows/Columns: (7307, 8409)
Pixel Spacing: (0.002599922606502, 0.002599922606502)
Downsampling Factors: (3.9997262898590393, 3.999881079795457)
=== Pyramid Level 3 ===
Total Pixel Matrix Rows/Columns: (3654, 4205)
Pixel Spacing: (0.005199226919876, 0.005199226919876)
Downsampling Factors: (7.998357963875205, 7.998810939357908)
=== Pyramid Level 4 ===
Total Pixel Matrix Rows/Columns: (1827, 2103)
Pixel Spacing: (0.010395981549253, 0.010395981549253)
Downsampling Factors: (15.99671592775041, 15.993818354731337)
=== Pyramid Level 5 ===
Total Pixel Matrix Rows/Columns: (914, 1052)
Pixel Spacing: (0.020782080986767, 0.020782080986767)
Downsampling Factors: (31.975929978118163, 31.972433460076047)
=== Pyramid Level 6 ===
Total Pixel Matrix Rows/Columns: (457, 526)
Pixel Spacing: (0.041564161973534, 0.041564161973534)
Downsampling Factors: (63.951859956236326, 63.944866920152094)

Note that the Pixel Spacing is different although the Total Pixel Matrix Rows/Columns are the same (the Imaged Volume Height/Width are also different).

That information can also be found in the console: Screen Shot 2022-08-31 at 8 02 35 PM

@dclunie could you kindly help us debug these data sets?

In general we need to improve the error handler in Slim.

I see 3 current issues regarding error handling

https://github.com/herrmannlab/slim/issues/106 https://github.com/herrmannlab/slim/issues/122 https://github.com/herrmannlab/slim/issues/123

We can talk the various specifics tomorrow, but in general error handler should not block the viewer. In addition, the error logger service should always report in a popup dialog or separate debug window (like we do for OHIF).

For customized error handler we can implement indeed callbacks that we can setup in the config file, e.g.: https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/idc.js#L12

Anyway i have put this already in tomorrow agenda https://cornerstonejs.slack.com/archives/GP0DDMVMF/p1660725079247979