[Paraview] Help with Programmable Filters

Scott, W Alan wascott at sandia.gov
Fri Apr 15 17:18:24 EDT 2016


From a user:



Hi
I'm trying to get started with programmable filters and am having a little trouble putting it together from the material in the paraview user guide. I have a few questions below:

1.       Is there any documentation generally describing the input and output data objects that form the programmable filter API?

a.       I was able to get some basic info on these objects by executing "print dir(inputs[0])" for example in the program. filter window, but if there is documentation somewhere for each of the object types, that would be useful...

2.       It appears that the user guide suggested methods for accessing the data in the input objects (input.Points, input.PointData['Name'], etc) produce vtk data objects of some form. These can be indexed similar to numpy arrays, but seem to behave differently in other cases. For instance, I couldn't figure how to reshape these arrays (numpy.reshape fails as the vtk array objects don't have any shape attribute defined...). Is there any way to get the input data into actual numpy array form? This would be helpful for direct reuse of existing scripts designed to work on numpy arrays...

3.       I was attempting to write a simple script that does some calcs on a block structured input dataset (input comes in as vtkCompositeDataSet) and writes out some reduced data to a table (I chose vtkTable as the output format). Through inspection of the output object, I found that I could add new rows (which appear in paraview as columns...) of data using output.RowData.append(DATA,NAME). However, DATA needs to be some basic python sequence type or numpy array, and the vtk array types created by the input data access methods (input.Points etc...) don't work... So again here, if there is a good way to convert the data held in the vtk array types to numpy array types, that would be useful here...

Thanks,
Jon




Thanks,

Alan


More information about the ParaView mailing list