I know that I can use the Calculator filter for operations on arrays, but I want to perform some more complicated computations. I managed to do it in Paraview python shell, but the missing step now is to go back to the viewer again (or save the new polydata to file). Here is what I have so far:
polydata = servermanager.Fetch(FindSource("mydataalreadyopeninparaview"))
region_size = paraview.vtk.vtkIntArray()
region_size.SetNumberOfComponents(0)
region_size.SetName("regionsize")
for i in range(polydata .GetNumberOfPoints()):
region_size.InsertNextValue(somecomputedvalue)
polydata.GetPointData().AddArray(region_size)
How can I "import" in the paraview pipeline my newly created data?