Loading large number of models

Hi, I have more than 300 models that I want to load into Slicer at the same time, each is around 100-150 megabytes. Slicer was able to load all of them but when I tried to set one of the model visible along with a color legend bar using a custom module button, Slicer crashed and produced these error logs:

[CRITICAL][Qt] 17.06.2019 15:12:42 [] (unknown:0) - “Slicer has caught an internal error.\n\nYou may be able to continue from this point, but results are undefined.\n\nSuggested action is to save your work and restart.\n\nIf you have a repeatable sequence of steps that causes this message, please report the issue following instructions available at http://slicer.org\n\n\nThe message detail is:\n\nException thrown in event: bad allocation”
[ERROR][VTK] 17.06.2019 15:12:43 [vtkFloatArray (0000028A362E5320)] (d:\d\p\slicer-0-build\vtk\common\core\vtkGenericDataArray.txx:452) - Unable to allocate 961938 elements of size 4 bytes.
[CRITICAL][Qt] 17.06.2019 15:12:43 [] (unknown:0) - “Slicer has caught an internal error.\n\nYou may be able to continue from this point, but results are undefined.\n\nSuggested action is to save your work and restart.\n\nIf you have a repeatable sequence of steps that causes this message, please report the issue following instructions available at http://slicer.org\n\n\nThe message detail is:\n\nException thrown in event: bad allocation”
[ERROR][VTK] 17.06.2019 15:12:45 [vtkFloatArray (0000028AB87905A0)] (d:\d\p\slicer-0-build\vtk\common\core\vtkGenericDataArray.txx:452) - Unable to allocate 1487484 elements of size 4 bytes.
[CRITICAL][Qt] 17.06.2019 15:12:45 [] (unknown:0) - “Slicer has caught an internal error.\n\nYou may be able to continue from this point, but results are undefined.\n\nSuggested action is to save your work and restart.\n\nIf you have a repeatable sequence of steps that causes this message, please report the issue following instructions available at http://slicer.org\n\n\nThe message detail is:\n\nException thrown in event: bad allocation”
[WARNING][Qt] 17.06.2019 15:14:01 [] (unknown:0) - QWindowsWindow::setGeometry: Unable to set geometry 1602x1137+1920+23 on QWidgetWindow/‘qSlicerMainWindowWindow’. Resulting geometry: 1600x1137+1920+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 1602x537, maximum size: 16777215x16777215).

This does not happen if I only load around 150 or less models. Should I use another machine with larger memory or what is the error indicating here? Also, these models were originally Abaqus volumes that I have converted into vtu using the scripts available here with some modifications (https://github.com/Liujie-SYSU/odb2vtk). Thanks!

Hi - Anytime you see the “bad allocation” message it means you’ve run out of memory. One option of course is to add more RAM to your computer or add virtual memory or maybe just use a bigger computer.

1 Like

You can reduce memory needs by 10-100x if you extract the visible outer surface of the mesh and visualize only that (instead of the unstructured grid volumetric mesh) and apply decimation.

2 Likes

Actually what is the proper why of doing this from CT scans? We will be segmenting a large number bones from mouse skulls, and for our purposes external surface is sufficient.

Segmentation already produces surface mesh. @ghnguyen got his models imported from FEM software, which works with volumetric meshes.