DescriptiveStatistics Filter or vtkDescriptiveStatistics

Helloo
I’d like to calculate some statistics inside of a clip filter. It seems like there are 2 different ways of doing that.

  1. apply the DescriptiveStatisticsFilter on the ClipFilter
  2. write a script that’s using vtk.vtkDescriptiveStatistics

In the end I will use a Python Script to export the values, so maybe its better to calculate from within my script using vtk.vtkDescriptiveStatistics.

How does that work in general?

For example there are 150Points in my Clip. I’d like to compute the mean value and standard Deviation of these values.

Hi @Resa,

You can use either approach inside a script. If you use ParaView’s DescriptiveStatistics filter, your python script should be run with pvpython or pvbatch (for distributed-memory parallelism). If you use the VTK filter directly, you will run your script with vtkpython. (If you have your PYTHONPATH set properly, you can use the plain python interpreter whose python libraries ParaView/VTK link against).

To understand how the statistics filters work in general, this blog post does a good job of explaining the process. As far as interpreting the vtkTable data that the filters output, here is a description. In your example, the mean and standard deviation will be in the table output by the “Derive” phase of the filter. The second link describes how to find the right entries in the table.

1 Like