But my slicer keeps closing after running the code. I suppose that “distanceFilter.Update()” might be responsible for that because it stops closing when I remove the update.
Is this a problem from my end or slicer bug, please?
The most likely reason is that there is something wrong with the inputs.
Nevertheless, VTK library should display a meaningful error message explaining what is wrong with the inputs in instead of just crashing. Try with the latest Slicer Preview Release and if ytou can make that crash, too, then describe the exact steps you do to get to this error and we’ll report it to VTK developers.
Yes, you are right. One of my inputs was the reason for the crash.
I don’t know why though.
The defective input is a tube created with a vtkTubeFilter through a vtkLineSource.
I used node = getNode(“myTube”) to get the node of the tube, and node_p = node.GetPolyData() to get the polydata of the node which I then gave as input to distanceFilter.SetInputData(0, node_p).