[vtkusers] Scalar interpolation

Jothybasu Selvaraj jothybasu at gmail.com
Wed May 9 09:41:05 EDT 2012


This should help you

vtkSmartPointer<vtkProbeFilter>pf=
vtkSmartPointer<vtkProbeFilter>::New();
pf->SetInput(cube);//cube as vtkImageData
pf->SetSource(line);line as vtkPolyData
pf->Update();

//Returns the result as a vtkTable
vtkSmartPointer<vtkDataObjectToTable>polyDataToTable=
vtkSmartPointer<vtkDataObjectToTable>::New();
polyDataToTable->SetInputConnection(pf->GetOutputPort());
polyDataToTable->SetFieldType(vtkDataObjectToTable::POINT_DATA);
polyDataToTable->Update();

Jothy

On Wed, May 9, 2012 at 2:17 PM, Brian Curtis <bcurtis3 at masonlive.gmu.edu>wrote:

> Hi,
>
> I'm looking for an example that does this or a few examples that show the
> proper way to do this.
>
> I'm not sure how to understand vtkProbeFilter from http://www.vtk.org/doc/
> **nightly/html/**classvtkProbeFilter.html<http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html>and what part of it will do the work I need.
>
> vtkProbeFilter->Probe requires three vtkDataSet but how do I get my points
> into a dataset?
>
> Thanks for your help,
> ~Brian
>
> On 05/08/2012 11:10 AM, Brian Curtis wrote:
>
>> Hi,
>>
>> I am interested in creating the following simple example in order to
>> expand off of at a later time:
>> - Create a cube (8 points) with scalar values all set to 1
>> - Create a line (5 points) that intersects with cube
>> - Get scalar interpolations for the line from the cube
>>
>> Cube pts:
>> float pts[8][3] = { {-1.0, -1.0, -1.0}, {-1.0, 1.0, -1.0},
>>                        {-1.0, 1.0, 1.0}, {-1.0, -1.0, 1.0},
>>                        {1.0, -1.0, -1.0}, {1.0, 1.0, -1.0},
>>                        {1.0, 1.0, 1.0}, {1.0, -1.0, 1.0} };
>> Line pts:
>> float line[5][3] = { {-2.0, 2.0, -2.0}, {-1.0, 1.0, -1.0},
>>                         {0.0, 0.0, 0.0}, {1.0, -1.0, 1.0}, {2.0, -2.0,
>> 2.0} };
>>
>> I could not find a simple example to do this, and I'm not exactly sure if
>> probefilter is the right way to go about this. What the best (and easiest)
>> way to approach this problem?
>>
>> Thanks,
>> ~Brian
>>
>> ______________________________**_________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/**
>> opensource/opensource.html<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 <http://www.vtk.org/Wiki/VTK_FAQ>
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/**listinfo/vtkusers<http://www.vtk.org/mailman/listinfo/vtkusers>
>>
>>
>
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<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 <http://www.vtk.org/Wiki/VTK_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/**listinfo/vtkusers<http://www.vtk.org/mailman/listinfo/vtkusers>
>



-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120509/00ce9a97/attachment.htm>


More information about the vtkusers mailing list