I’d like to calculate some statistics inside of a clip filter. It seems like there are 2 different ways of doing that.
- apply the DescriptiveStatisticsFilter on the ClipFilter
- 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.
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.