I try to create a vtkMRMLScalarVolumeNode
by calling slicer.mrmlScene.AddNewNodeByClass("vtkMRMLScalarVolumeNode")
, but slicer crashed after calling this method.
Messages below are output of terminal:
Input port 0 of algorithm vtkImageThreshold(0x562d37c530a0) has 0 connections but is not optional.
Input port 0 of algorithm vtkImageMapToWindowLevelColors(0x562d37c696f0) has 0 connections but is not optional.
Input port 0 of algorithm vtkImageMapToWindowLevelColors(0x562d37c696f0) has 0 connections but is not optional.
Input port 0 of algorithm vtkImageThreshold(0x562d37c530a0) has 0 connections but is not optional.
Input port 0 of algorithm vtkImageMapToWindowLevelColors(0x562d37c696f0) has 0 connections but is not optional.
Segmentation fault (core dumped)
I used gdb to debug the program and found that Slicer crashed at build/VTK/Rendering/OpenGL2/vtkOpenGLImageMapper.cxx:616
switch (data->GetPointData()->GetScalars()->GetDataType())
data->GetPointData()->GetScalars()
returns a nullptr which triggered the segmentation fault.
How can I fix this problem? It works fine on Windows but crashes everytime on my ubuntu desktop.
OS: ubuntu 18.04
Slicer Version:5.0.3 (7ea0f439e837fca8c92a315fb0b2a9b0ff28e1e4)