[vtkusers] interpolation by vtk
yaya
yaya_aisi at hotmail.com
Thu Sep 13 12:05:14 EDT 2007
Hi all,
I have a question about interpolation by vtk.
Now there are some points: (x, y, z, a). For example:
3.4 5.6 2.3 1.0
6.5 7.1 13.3 2.0
3.3 123.9 101.1 9.0
12.2 98.1 1.9 12.0
…
99.0 23.0 12.8 3.7
The first three value of each point means the coordinate value “x, y, z” of the point, and the fourth value “a” means the attribute value of the point (maybe means the color of the point or something like that).
Now I want to interpolate these points onto regular grid points, can I use vtk to realize it?
By the way, I know that vtkProbeFilter can do the interpolation work. I’ve tried it:
vtkImageData *image=vtkImageData::New();
image->SetDimensions(60,60,60);
image->SetSpacing(0.3,0.3,0.3);
image->SetOrigin(0,0,0);
vtkDataSetReader *reader =vtkDataSetReader::New();
reader->SetFileName("test.vtk");
vtkProbeFilter *probe=vtkProbeFilter ::New();
probe->SetInput(image);
probe->SetSource(reader->GetOutput());
But I found that when test.vtk is unstructured_grid and the cell types are all equal to 1, that is, the data file consist of scattered points, the output has nothing we can see, and the output file is structured_points, and the attribute value of each structured point is equal to 0. So I guess that when we use the vtkProbeFilter, the cell type of the input file can not be 1.
Then, how to interpolate these points onto regular grid points by vtk? Who can help me? Thanks a lot!
_________________________________________________________________
MSN 中文网,最新时尚生活资讯,白领聚集门户。
http://cn.msn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070913/c7b75c79/attachment.htm>
More information about the vtkusers
mailing list