Create a reader plugin to read multiple files into one vtkMultiBlockDataSet

Dear Experts,
Is it possible to write a reader plugin that can read multiple files’ content into one vtkMultiBlockDataSet?

In my situation, the data in each file is just a small block of the whole data, so i need to read them into one vtkMultiBlockDataSet then user selected all the files from UI.

Then in the pipeline browser view, all the file blocks will have the same parent

Any suggestion how to do this?

Thanks and Best Regards,

Sharon

You can’t create a reader that will output a single multiblockdataset and at the same time, have an item in the pipeline browser for each block.
But take a look into the Multiblock inspector instead (View -> MultiblockInspector)

Other then that, it is definitelly possible to a plugin that expose a reader that read multiples files into one vtkMultiBlockDataSet.

Thank you Mathieu!
I tried GroupDatasets filter, it works.
However, if i load 2 files, after this filter, there will be 3 groupDataSets and the last one is the one that contain all the blocks.

I expected result is only one groupDataSet, and its children under it, just like a tree view

Thank you!

Best Regards,
Sharon

If you implement your own filter, you have a full freedom on how the block are organized.

How to implement this? i found the pipeline already hard code one reader can only receive one file name…

A reader can receive a directory name.

1 Like

Thank you Mathieu!

I will have a try for this!

Best Regards

You mean I can read all the files under the same directory when user choose one file?

I am confused when user choose a directory, how can paraview know which reader to use?

And if i write my own reader, how can tell paraview to use my reader after user select certain directory?

Because for a file, there is a suffix to tell reader, but for a directory, how to know?

Yes

There is a pattern mechanism in the XML definition of the reader, see AMReX Particles Reader in readers.xml

Yes, I just tried to open a directory and found the reader you mentioned is appeared on the UI.
OK, I will take a look at it!

Big Thank You to you, Mathieu!

You really give me some ideas!

very Best Regards to you,
Sharon