Page MenuHomePhabricator

Crash when loading two images with very different spacings
Closed, WontfixPublic

Assigned To
Authored By
isensee
Oct 26 2021, 10:32 AM
Referenced Files
F2460615: Screenshot from 2021-10-26 10-31-09.png
Oct 26 2021, 10:32 AM
F2460614: recon_+300_00163.tif
Oct 26 2021, 10:32 AM
F2460613: Grey Channel321 UBYTE0010.tiff
Oct 26 2021, 10:32 AM
Subscribers

Description

Me neither. It's just two 2D images. One is uint8, the other is uint16.

Loading each of them individually works. They just don't like each other.

(error in terminal:)

2021-10-26 10:29:01.789 ( 14,563s) [ 6FF99800]vtkGenericDataArray.txx:389 ERR| vtkUnsignedCharArray (0x55f59aa75370): Unable to allocate 81453160000 elements of size 1 bytes.
#15.429# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Common/Core/vtkGenericDataArray.txx, line 389
vtkUnsignedCharArray (0x55f59aa75370): Unable to allocate 81453160000 elements of size 1 bytes.
#15.430# ERROR: An error occurred: std::exception
2021-10-26 10:29:02.840 ( 15,614s) [ 6FF99800] vtkExecutive.cxx:780 ERR| vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
#26.139# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 780
vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
2021-10-26 10:29:02.840 ( 15,614s) [ 6FF99800] vtkExecutive.cxx:780 ERR| vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
#26.139# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 780
vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
2021-10-26 10:29:02.840 ( 15,614s) [ 6FF99800] vtkOpenGLTexture.cxx:206 ERR| vtkNeverTranslucentTexture (0x7f71fc078d90): No scalar values found for texture input!
#26.139# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Rendering/OpenGL2/vtkOpenGLTexture.cxx, line 206
vtkNeverTranslucentTexture (0x7f71fc078d90): No scalar values found for texture input!
2021-10-26 10:29:02.841 ( 15,615s) [ 6FF99800] vtkExecutive.cxx:780 ERR| vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
#26.140# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 780
vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
2021-10-26 10:29:02.841 ( 15,615s) [ 6FF99800] vtkExecutive.cxx:780 ERR| vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
#26.140# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Common/ExecutionModel/vtkExecutive.cxx, line 780
vtkCompositeDataPipeline (0x55f59a4a7490): UpdateInformation invoked during another request. Returning failure to algorithm vtkMitkLevelWindowFilter(0x55f59a487790).
2021-10-26 10:29:02.841 ( 15,615s) [ 6FF99800] vtkOpenGLTexture.cxx:206 ERR| vtkNeverTranslucentTexture (0x7f71fc078d90): No scalar values found for texture input!
#26.140# [VtkError] ERROR: ERROR: In /home/ubuntu/jenkins-agent/MITK/Snapshots/build/ep/src/VTK/Rendering/OpenGL2/vtkOpenGLTexture.cxx, line 206
vtkNeverTranslucentTexture (0x7f71fc078d90): No scalar values found for texture input!

Screenshot from 2021-10-26 10-31-09.png (248×500 px, 17 KB)

Snapshot 2021-10-18
Ubuntu 18.04

Event Timeline

Yes it looks like I am running OOM. Strange stuff. Loading each image individually MITK barely uses any RAM. As soon as I load both RAM usage jumps up to 20GB (out of my 32GB ) right before it crashes. Also CPU util is high just before that.

kislinsk renamed this task from Trying to load these two images? You won't believe what happens next...! to Crash when loading two images at the same time.Oct 29 2021, 8:34 AM
kislinsk renamed this task from Crash when loading two images at the same time to Crash when loading an image while another one is already loaded.Oct 29 2021, 8:38 AM

Insights:

  • It works when any other 3-d data like Pic3D.nrrd or ball.stl is already opened.
  • The problematic image is Grey Channel321 UBYTE0010.tif which initiates the condition
    • Loading recon_+300_00163.tif image twice works
    • Loading recon_+300_00163.tif and Png2D-bw.png works
    • Loading Grey Channel321 UBYTE0010.tif twice works
    • Loading Grey Channel321 UBYTE0010.tif and any other 2-d images crashes

Somewhere deep in the VTK rendering pipeline the extent of an image is suddenly set to 142700x142700 which is the 20 GB of memory that can be observed.

142700 happens to be exactly the original image dimension times 100. Looking at the geometry of Grey Channel321 UBYTE0010.tif I noticed that the spacing is 0.01 in all directions. As long as it is loaded as single image, our 2-d image mapper just creates a texture with the original extent but as soon as there is the other image with the same extents but a spacing of 1 in all directions the least common multiple size for a common texture is 142700x142700.

This concept of our 2-d image mapper was a pretty bad decision in the very beginnings of MITK and there were a few attempts to rewrite it with multiple textures instead but it is such a deeply nested mess that nobody ever succeeded a gave up sooner or later. Short: A fix for this bug is nearly impossible unfortunately.

But: Why does the segmentation image have such a strange spacing anyways, since it seems to be originated from the other image? Make sure that it has the same spacing and it should work as expected. At the current state, if there would be enough memory to load and render both images, they wouldn't be congruent as I guess you would expect them to be since one image would be 100x smaller than the other. I didn't check yet but maybe the spacing is derived from the DPI of the TIF image.

kislinsk renamed this task from Crash when loading an image while another one is already loaded to Crash when loading two images with very different spacings.Oct 29 2021, 9:50 AM
kislinsk closed this task as Wontfix.
kislinsk triaged this task as Normal priority.
  • recon_+300_00163.tif has 72 pixels/inch (which is a common default value for strange early-day web reasons)
  • Grey Channel321 UBYTE0010.tif has 2540 pixels/inch or 1000 pixels/cm (which seems to be either the original value or something a program or programmer completely made up as default)

I equalized the PPI of the images in Photoshop and they load in MITK as expected.

Crazy stuff and good find 👍 Thanks Stefan!

Yes spacing is annoying with these images. Sometimes it's saved properly, sometimes it isnt. Tiff...