[vtkusers] How to convert point data into proper datatype in vtk?
Johannes Strecha
j.strecha at gmail.com
Wed Dec 5 03:08:14 EST 2012
Hello again,
What do you mean by "not ideal", doesn't it look like expected, or doesn't
it work?
I'm not sure if you need the Delauny triangulation if you start with a
structured grid. I think the points in the grid should have coordinates
time/index/0, the stock price should go as an array into the pointdata if
you want to use warpscalar. I never worked with structured grids before
(only unstructured) so I can only guess.
Try to read the reference (http://www.vtk.org/doc/release/5.8/html/) to get
an idea what you need to specify. I think if you do not really know how
your data structure should look like it's easier to construct it in memory
and then use a writer class instead of constructing the datafile by hand.
Kind regards,
Johannes Strecha.
On Tue, Dec 4, 2012 at 10:55 PM, boyeggplant110 <boyeggplant110 at gmail.com>wrote:
> Hi,****
>
> Thanks for your reply.****
>
> I want to use vtk to construct a program to visualize the stock price. The
> stock price is static here, not time varying. I want to do something like
> the attachment. I want to order the stock by x-coordinates so the
> x-coordinates is stock index(or stock name),y-coodinates is time, and
> z-coordinates is price. ****
>
> I want to use height field to implement this.****
>
> I use vtkDelaunay2D and vtkWarpScalar to handle my dataset but the result
> is not ideal****
>
> Do you have any suggestions?****
>
> ****
>
> ** **
>
> *JIE LI*****
>
> *Master of Science in Statistics*****
>
> *Division of Statistics + Scientific Computation *****
>
> *The University of Texas at Austin| 1 University Station G2500| Austin,
> TX 78712* ****
>
> ** **
>
> *From:* Johannes Strecha [mailto:j.strecha at gmail.com]
> *Sent:* 2012年12月4日 13:04
> *To:* boyeggplant110; vtkusers at vtk.org
> *Subject:* Re: [vtkusers] How to convert point data into proper datatype
> in vtk?****
>
> ** **
>
> 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/20121205/00659039/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 26557 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121205/00659039/attachment.jpeg>
More information about the vtkusers
mailing list