I’m writing a Python script (macro) in Paraview and I’m currently facing the following problem: My data source is a VTK XML file that is opened in Paraview, which, apart from the geometry and point data, should also contain some additional custom data. I intend to store it simply as unaligned field data there. Now depending on this custom data, from my Python script, I have to apply a varying number of filters to the data. So the main question is how to best access this field data from the client-side Paraview script.
I know that I can use servermanager.Fetch() to get the whole object sent to the client, which would be somewhat okay since so far, I’m not using a remote server. However since I’m only interested in a tiny piece of data (that one field), I wanted to ask if there’s a better method to access it, since I really want to refrain from transmitting the whole structure if at some point I’m actually using a remote connection.
The problem is that I want to extract a varying number of objects out of the data. As far as I know, there is no possibility of having a filter with a variable number of outputs, or am I mistaken? This is why I thought to apply the same filter a number of times, parameterized by the object to extract. But this I would have to do client-side, right?
As far as I know, there is no possibility of having a filter with a variable number of outputs
Indeed, for that usecase we tend to use multiblocks output.
In any case, your idea could work using fetch(). You can use param to recover only a integrated version of the data, but I’m not sure that the field data would still be available. Another solution could be to write a programmable filter to do the integration before you do the fetch.
Oh, I was not aware that something like this exists. Actually, multiple blocks as output would be perfectly fine. So can I write a programmable filter that takes a single-block dataset as input and creates a multi-block output? Can you provide me with some reference for this? In the docs I only found how to process already-existing multiblock data.
Sorry, but what do you mean by that? Unfortunately I’m not that familiar with VTK, so what would an integrated version of the data be?