Filter points from Polydata

I have a vtkPolyData data object, which is used as input data to a vtk.Rendering.Core.vtkGlyph3DMapper to plot spheres. These polydata have scalars mapped to them which are used to colour the spheres.

I am trying to see how I can filter these polydata based on these scalars. So, for example, say all my polydata points have scalars in the range of 0-9. How can I not plot those data points which have a scalar value of 5?

Many thanks

You can use vtkThreshold. The output of this filter is a vtkUnstructuredGrid (which works: you can put any cells from a vtkPolyData inside a vtkUnstructuredGrid).

@Yohann_Bearzi this is for vtk.js. We do not have vtkUnstructuredGrid or vtkThreshold.

But the idea is correct. You just need to create your own filter that will act as a vtkThreshold by filtering the cells of your polydata. Basically you just want to list the points that fulfill your condition.

Such filter would be trivial to write in JS and build the corresponding pipeline in vtk.js.