[vtkusers] How to convert point data into proper datatype in vtk?

Johannes Strecha j.strecha at gmail.com
Tue Dec 4 14:03:50 EST 2012


Hello,

sorry, haven't got the time to check your specific file. Here is a
description of the legacy vtk file format:
http://www.vtk.org/VTK/img/file-formats.pdf

I try to avoid constructing such files by hand. If you know (or want to
learn) python you can construct your dataset in memory (by calling
*.InsertNextPoint(...) or so, depends on your data structure). On the
plus-side you get to know the vtk data structures really well and you can
use one of the numerous writer-classes to write your datafiles as xml or
legacy-files, with or without compression, ...

3 things: there's a surplus U in structured_grid & I'm not too sure how
stock prices can be visualized by a structured grid, but maybe you thought
of something special. Have you had a look at gnuplot or matplotlib? They
can do simple visualizations very good, maybe using vtk is a bit of an
overkill.

Kind regards,
Johannes Strecha.


On Tue, Dec 4, 2012 at 4:49 PM, boyeggplant110 <boyeggplant110 at gmail.com>wrote:

> Hi all,****
>
> I have a problem about how to convert point data to proper data type in
> vtk. I have a dataset including stock prices. So I have 3 variables: stock
> price, time, and stock index. I want visualize the dataset but it doesn’t
> work when I want to construct a structured grid vtk file(as following). I
> wonder if my method to convert the data is right.****
>
> Example :****
>
> # vtk DataFile Version 2.0****
>
> test data****
>
> ASCII****
>
> DATASET STRUCUTURED_GRID****
>
> DIMENSIONS 30 30 30****
>
> POINTS 30 float****
>
> ****
>
> 1              1              36.32        ****
>
> 1              2              36.61        ****
>
> 1              3              36.48        ****
>
> 1              4              36.64        ****
>
> 1              5              35.78        ****
>
> 1              6              35.94        ****
>
> 1              7              37.04        ****
>
> 1              8              36.97        ****
>
> 1              9              37.65        ****
>
> 1              10           37.63        ****
>
> 2              1              76.78        ****
>
> 2              2              75.58        ****
>
> 2              3              79.05        ****
>
> 2              4              80.28        ****
>
> 2              5              78.64        ****
>
> 2              6              78.95        ****
>
> 2              7              82.58        ****
>
> ** **
>
> The first column is stock index, second is time, third is price.****
>
> ** **
>
> Thanks in advance!****
>
> ** **
>
> *JIE *****
>
> ** **
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121204/b9e950cd/attachment.htm>


More information about the vtkusers mailing list