# How to propagate non-VTK data in the pipeline in a simple way?

**URL:** https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472
**Category:** Support
**Tags:** pipeline, python
**Created:** [June 23, 2026, 5:10pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472 "2026-06-23T17:10:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/csatizoltan/32/6040_2.png) [@CsatiZoltan](https://discourse.vtk.org/u/CsatiZoltan)
#### Post date: [June 23, 2026, 5:10pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472/1 "2026-06-23T17:10:14Z")

</div>

I have a ParaView reader plugin in Python, which stores the path to the opened file. I want to implement various operations on the file that was read by the reader. So I write one filter for each operation. This way, I have to propagate the file path from the reader to the filter in the pipeline. The file path is a Python string.

Essentially, this is a very similar question to [this one](https://discourse.paraview.org/t/trying-to-use-the-vtkinformation-vtkinformationkey-system-for-own-purposes/10568) and to [this one](https://discourse.vtk.org/t/set-get-fielddata-with-numpy-interface-dataset-adapter/4550). I tried various approaches, but I am wondering if there exists a simpler one.

In all the approaches, the idea is that the custom data (here: file path string) is set as a `vtkInformation` key in the`RequestInformation` method of the reader, and fetched from the `RequestInformation` method of the filter.

Approaches:

1. Pass as a string key

2. Pass as a `vtkFieldData`  
In his [blog post](https://www.kitware.com/a-vtk-pipeline-primer-part-2/) ([code here](https://github.com/berkgeveci/berkgeveci.github.io/blob/jekyll/code/2014-09-16-pipeline/pipeline.py)), Berk Geveci uses `vtkInformationDataObjectMetaDataKey` to pass metadata. However, you can only associate VTK data objects with that key, so no string. The [solution](https://discourse.vtk.org/t/set-get-fielddata-with-numpy-interface-dataset-adapter/4550/5) is to store your Python string in a `vtkStringArray` and add that `vtkStringArray` object to the field data of a VTK object. Additional complexity: it must be wrapped for Python with a dataset adapter.  
In the initializer of the reader, I allocate a wrapped polydata object (could be a different VTK data object, we just need it for its `vtkFieldData` member):

3. Use `KEYS_TO_COPY()` for custom keys. I haven’t tried [this approach](https://discourse.paraview.org/t/set-size-of-stringvectorproperty-list-at-loading-of-state-file/845/5), but it seems to be [less general](https://discourse.paraview.org/t/trying-to-use-the-vtkinformation-vtkinformationkey-system-for-own-purposes/10568/2).

Approach 2 works for me, but it is an overkill: many layers of wrapping just to pass a simple string down the pipeline. What is the recommended way of doing it in 2026?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [June 23, 2026, 9:43pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472/2 "2026-06-23T21:43:27Z")

</div>

Approach 2, but I would just add the string to a field data in `RequestData`. Then it’s available in all downstream filters.

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/csatizoltan/32/6040_2.png) [@CsatiZoltan](https://discourse.vtk.org/u/CsatiZoltan)
#### Post date: [June 23, 2026, 10:43pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472/3 "2026-06-23T22:43:44Z")

</div>

What do you mean, could you give an example?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [June 23, 2026, 10:48pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472/4 "2026-06-23T22:48:23Z")

</div>

I just mean that your custom filter could add field data to the output it generates instead of your example #2 where you create a new polydata to store an array and pass that around as a key. Just grab the data object produced by your source/filter, add a field data array to it, and access it from downstream filters to do something.

The information key approach is cleaner than what I suggested above as it doesn’t otherwise touch the data, but it is more verbose. If you don’t mind your metadata riding along with the main data your source/filter produces, then you can do what I described above.

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/csatizoltan/32/6040_2.png) [@CsatiZoltan](https://discourse.vtk.org/u/CsatiZoltan)
#### Post date: [June 23, 2026, 10:50pm UTC](https://discourse.vtk.org/t/how-to-propagate-non-vtk-data-in-the-pipeline-in-a-simple-way/16472/5 "2026-06-23T22:50:53Z")

</div>

Now I understand, thank you!
