vtkXMLReader and vtkXMLWriter data headers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vtkXMLReader and vtkXMLWriter data headers

Edern Haumont
Hello,

I am writing a python application which requires to send a stored compressed vtkImageData by block to a client.
I read on this (https://www.vtk.org/Wiki/VTK_XML_Formats) link (and by looking at the vtkXMLWriter source) that the actual data array is preceded by some header. Either :
- [#bytes][DATA] if the data is not compressed
- [#blocks][#u-size][#p-size][#c-size-1][#c-size-2]...[#c-size-#blocks][DATA] if it is compressed.

My problem : I did not succeed in manually reading those values, either in the uncompressed (binary or ascii) or compressed case. Does anyone have any pointer or example on how to do that ? I could not find a lot of documentation on the subject.

Also side question : I am not sure the ZLib compressor uses a full flush. If that is not the case, it seems impossible to read only one random data block. Am I right ?

Thanks a lot.
Bests.

--
Edern Haumont
[hidden email]

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkXMLReader and vtkXMLWriter data headers

Sebastien Jourdain-2
You might be able to find some good comments or logic in that code base


On Mon, Jun 25, 2018 at 7:20 AM Edern Haumont <[hidden email]> wrote:
Hello,

I am writing a python application which requires to send a stored compressed vtkImageData by block to a client.
I read on this (https://www.vtk.org/Wiki/VTK_XML_Formats) link (and by looking at the vtkXMLWriter source) that the actual data array is preceded by some header. Either :
- [#bytes][DATA] if the data is not compressed
- [#blocks][#u-size][#p-size][#c-size-1][#c-size-2]...[#c-size-#blocks][DATA] if it is compressed.

My problem : I did not succeed in manually reading those values, either in the uncompressed (binary or ascii) or compressed case. Does anyone have any pointer or example on how to do that ? I could not find a lot of documentation on the subject.

Also side question : I am not sure the ZLib compressor uses a full flush. If that is not the case, it seems impossible to read only one random data block. Am I right ?

Thanks a lot.
Bests.

--
Edern Haumont
[hidden email]
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers