Skip to content

ENH: Fixed warning when slice intersection display enabled for empty polydata

Andras Lasso requested to merge github/fork/lassoan/empty_polydata_warning into master

When a new model node was created (or polydata was reset in an existing model node) and model slice intersection display was enabled then VTK logged a lot of warnings. It is a normal use case to have empty model node, so no warnings should be logged.

Added a check so that now if the polydata is NULL or does not contain any points then the model slice intersection actor visibility is turned off.

How to reproduce:


p = vtk.vtkPolyData() mn = slicer.vtkMRMLModelNode() mn.SetAndObservePolyData(p) slicer.mrmlScene.AddNode(mn) mn.CreateDefaultDisplayNodes()

mn.GetDisplayNode().SetSliceIntersectionVisibility(1)

Prints into the log:

No input data

No input data

No input data

No input data

No input data

No input data

Merge request reports

Loading