How to access information from a custom reader and read only a subset of data?

Hello!!

I’ve written a custom reader based on vtkPythonAlgorithmBase following the pattern from this blog written by Ben Geveci.

The file that I’m reading may contain one or more spatial data fields

I want to use this reader in a pipeline as follows,

  1. Populate a UI with the names of the fields available in the file. I have code (not part of the pipeline) that can return the field names/types without reading the entire file
  2. From the UI, the user will select one of the fields and the idea is that the pipeline will then render that field.

I have all of this working in a hacky sort of way but it reads EVERY field from the file. I’d like to clean this up so that the reader only reads the fields requested by the user.

How do I tell the reader to read only selected fields?