[vtkusers] help (I'm a newbie...)

Peter F Bradshaw pfb at exadios.com
Sat Sep 29 09:35:12 EDT 2007


Hi Trevis;

On Fri, 28 Sep 2007, Trevis Crane wrote:

> Hi all,
>
> I'm fairly new to programming in C++, and I'm brand new to VTK.  And I am
> having trouble finding a good way to visualize my data.
>
> I have an array of data points -- each data point has x,y,z and intensity
> values (doubles).  The data should be fairly well structured, but I don't
> want to bet on it.  That is, x (for example) should run from 0.0 to 0.49 in
> steps of 0.1, but it may vary here and there by a little bit.  So, I just
> want to plot slices of the data, where the slice's normal is along the
> z-axis.

Do you mean 0.0 to 0.49 in steps of 0.01?

>
> I found an example that does something really simimlar -- CutCombustor.py,
> but it gets its data by way of the vtkPlot3DReader, defines a plane object
> and uses the plane to cut slices out of the data.  Sounds great for me, but
> I don't know how to massage my data into something that I can pass to the
> vtkPlane::SetOrigin() function in such a way that when I plot my slice I see
> a filled contour plot (or something like that).

I suspect the best approach is to coerce the data into a
vtkStructuredGrid object. Since the data is substantially regular this
may be as simple as "snapping" the input points to the nearest
vtkStructuredGrid point - this will correspond to sample points with
error. A more correct approach would be to process the input data in a
fashion similar to sample rate conversion - this will certainly
introduce fringe effects at the extents of the data.

You do not say what form the data is in. Presumably it resides in files.
Do you have a reader that can read the format?

>
> So, if you have any suggestions on how to do this or better approach in
> general, please let me know!
>
> thanks for your help,
> trevis
>

Cheers

-- 
Peter F Bradshaw: http://www.exadios.com (public keys avaliable there).
Personal site: http://personal.exadios.com
"I love truth, and the way the government still uses it occasionally to
 keep us guessing." - Sam Kekovich.



More information about the vtkusers mailing list