Vtk-js: Support for <Array> & <Array type="string"> in XMLReader

Created on 16 Oct 2019  路  8Comments  路  Source: Kitware/vtk-js

Hi there,

Working with the attached data, I've noticed that:

  1. <Array> under <CellData> is not being processed (only <DataArray> is)
    I wonder why?
    It might also be a lack of knowledge of the format on my end, but it seems like both should be supported.
  1. Even if <Array> was processed, the string type would not be supported.
    Is that deliberate?

Again, it might be a hole in my knowledge regarding the format. Perhaps there is another mechanism to read <Array type="String"> that I am not aware of.

Do you have any hints / suggestions?
Thanks for the help,
Dan

example-vtp.zip

feature request 馃挕

Most helpful comment

I tried with the last version of vtk.js (13.4.2), precisely no, I don't want to skip the string arrays

If I serialize a polydata incore from javascript, String arrays are parsed and I can access Field Data.

But if I try to use the xml parser for from an existing .vtp file, I get two problems:

  • string arrays inside CellData are not parsed : you already say that this feature is not implemented yet

  • all the FieldData are not parsed: I see that in XMLPolyDataReader class that
    effectively, FieldData are not included in the parser. Is it planed to parse the FieldData arrays ? Or maybe there is another way to do this ?

All 8 comments

Hi Dan,

We skipped StringArray for now as we mostly focused on numerical data. Adding the Strings should not be too bad but it will require some coding.

Sorry about that,

Seb

No worries :)
Numerical data display is more common in most cases I suppose, so that makes sense.

Do you have any plans to support string arrays in the near future?
Thanks,
Dan

We sure want to support them. But only when we will need them that we will put the effort to integrate them. This could come from a customer request unless it get contributed by someone from the community. As of today, I don't have anyone (except you) that requested it. ;-)

Absolutely.
As it is, it's not the most important thing on my list, so I'm on the same page. If it becomes more important, we'd be happy to contribute one way or another :)

Hi,

I am facing the same problem for reading a vtp file containing a String Array in the section. How did you resolve your problem temporarly @danmindru ?

In my case , I have just some few words to assign to each cell, So I can use a integer array for the cells and add a field data which gives the association between the id and the string I wanted to assign

The latest stable version of Glance and vtk.js does properly skip the string arrays.

I tried with the last version of vtk.js (13.4.2), precisely no, I don't want to skip the string arrays

If I serialize a polydata incore from javascript, String arrays are parsed and I can access Field Data.

But if I try to use the xml parser for from an existing .vtp file, I get two problems:

  • string arrays inside CellData are not parsed : you already say that this feature is not implemented yet

  • all the FieldData are not parsed: I see that in XMLPolyDataReader class that
    effectively, FieldData are not included in the parser. Is it planed to parse the FieldData arrays ? Or maybe there is another way to do this ?

HI @jourdain,
Has there been any update on this? I am too interested in loading string-based arrays in Paraview Glance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlizzo picture rlizzo  路  3Comments

rjsgml5698 picture rjsgml5698  路  4Comments

truongleit picture truongleit  路  6Comments

BotellaA picture BotellaA  路  3Comments

aylward picture aylward  路  4Comments