[vtkusers] interpolation by vtk
David E DeMarle
dave.demarle at kitware.com
Thu Sep 13 12:23:49 EDT 2007
Probe filter needs cells with some extent to interpolate within. For each
output point, the filter finds out what input cell contains it, thereby
discovering what input points need to be interpolated. Then it does a
weighted interpolation of those points (the cell's points specifically). In
your case the output point doesn't know what input values to try
interpolating.
You could construct cells from your point data (perhaps with Delaunay) and
then use the probe filter.
cheers
Dave DeMarle
On 9/13/07, yaya <yaya_aisi at hotmail.com> wrote:
>
>
> 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!
>
> ------------------------------
> 不登录就能管理多个邮件帐户,试试 Windows Live Mail。 立即尝试!<http://get.live.com/betas/maildesktop_betas>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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/20070913/034ec2d5/attachment.htm>
More information about the vtkusers
mailing list