Add a new reader to read a custom data format

If I want to add a new reader to read a custom data format, do you have any good suggestions and opinions?

Hello @flow_zhang !

You have several options :slightly_smiling_face: but I assume that “custom data format” refers to a in-house data-format that no one else uses, so it may not be relevant to add it to the opensource ParaView (correct me if I’m wrong).

For adding a new reader the way to go is to create a plugin. You have two options : either create a Python plugin or a C++ plugin. The advantage of a Python plugin is that it can be loaded more easily in every version of ParaView and it may be easier to develop, but it can be slower than C++ plugin. On the other hand, a C++ plugin is faster and allow you more control over the performance and what you do but is harder to develop and can only be loaded in the ParaView you built it against.

Python plugin example : https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/PythonAlgorithm

C++ plugin example : https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/ElevationFilter

3 Likes

dear @timothee.chabat

thank you for your answer above! please could you add to it a short comparison with using a Programmable Source as a reader for a custom data format? i recall the ParaView Guide PDF mentioning a couple of years ago that the Programmable Source was a common way to prototype new reader designs. was this therefore hinting that many users would then naturally convert their Programmable Source code into ParaView Python Plugin code?

many thanks!
milan.

Programmable Source and Python plugins are indeed very similar (they use the same classes under the hood). Here’s the main 3 benefits I can think of for a Python plugin over a Programmable Source :

  • it’s way easier to distribute
  • you can have some properties directly integrated into ParaView GUI
  • it convey more meaning

Well if it’s just for a oneshot visualization then maybe you can stick with a programmable source, but otherwise I think that’s the way to think about it yes :slightly_smiling_face:

3 Likes

awesome, thank you!