<div dir="ltr"><div style>Hello all,</div><div style>I&#39;m having a problem with the vtkProbeFilter. I have a vtkUnstructuredGrid volume with one data field called MinPStrain and I am trying to probe it with a vtkPolyData surface. The output indicates that the two interact in only a very small portion of the surface, when in reality they almost completely overlap.</div>

<div style><br></div><div style>There are some screen shots at: <a href="https://plus.google.com/photos/101839812291734892344/albums/5881253191058882961?authkey=CIOdsYjQi8zKjQE">https://plus.google.com/photos/101839812291734892344/albums/5881253191058882961?authkey=CIOdsYjQi8zKjQE</a></div>

<div style><br></div><div style>On the left is the surface and volume in their actual positions. On the right is the output of the probe, translated so that it can be viewed.</div><div style><br></div><div style>Most recently I have tried using the vtkAppendFilter to convert the vtkPolyData to a vtkUnstructuredGrid, but to no avail. The latest code is:</div>

<div style><br></div><div style><div><font face="courier new, monospace">#include &lt;vtkUnstructuredGridReader.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkXMLUnstructuredGridWriter.h&gt;</font></div>

<div><font face="courier new, monospace">#include &lt;vtkPolyData.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkUnstructuredGrid.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkXMLPolyDataReader.h&gt;</font></div>

<div><font face="courier new, monospace">#include &lt;vtkXMLPolyDataWriter.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkProbeFilter.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkSmartPointer.h&gt;</font></div>

<div><font face="courier new, monospace">#include &lt;vtkAppendFilter.h&gt;</font></div><div><font face="courier new, monospace">#include &lt;vtkPointData.h&gt;</font></div><div><font face="courier new, monospace"><br></font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">int main(int argc, char **argv)</font></div><div><font face="courier new, monospace">{</font></div><div><font face="courier new, monospace">    // Read the volume</font></div>

<div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkUnstructuredGridReader&gt; volumeReader =</font></div><div><font face="courier new, monospace">        vtkSmartPointer&lt;vtkUnstructuredGridReader&gt;::New();</font></div>

<div><font face="courier new, monospace">    volumeReader-&gt;SetFileName(&quot;/home/seth/Desktop/volume.vtk&quot;);</font></div><div><font face="courier new, monospace">    volumeReader-&gt;Update();</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace">    // Read the surface</font></div><div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkXMLPolyDataReader&gt; polyReader =</font></div><div><font face="courier new, monospace">        vtkSmartPointer&lt;vtkXMLPolyDataReader&gt;::New();</font></div>

<div><font face="courier new, monospace">    polyReader-&gt;SetFileName(&quot;/home/seth/Desktop/aligned.vtp&quot;);</font></div><div><font face="courier new, monospace">    polyReader-&gt;Update();</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace">    // remove pre-existing array data</font></div><div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkPolyData&gt; inputSurface = polyReader-&gt;GetOutput();</font></div>

<div><font face="courier new, monospace">    unsigned int numberOfArrays = inputSurface-&gt;GetPointData()-&gt;GetNumberOfArrays();</font></div><div><font face="courier new, monospace">    for (unsigned int i = 0; i &lt; numberOfArrays; ++i)</font></div>

<div><font face="courier new, monospace">    {</font></div><div><font face="courier new, monospace">        inputSurface-&gt;GetPointData()-&gt;RemoveArray(i);</font></div><div><font face="courier new, monospace">    }</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">    std::cout&lt;&lt;&quot;Images Read&quot;&lt;&lt;std::endl;</font></div><div><font face="courier new, monospace"><br></font></div>

<div><font face="courier new, monospace">    // convert the surface from vtkPolyData to vtkUnstructuredGrid</font></div><div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkAppendFilter&gt; appender =</font></div>

<div><font face="courier new, monospace">        vtkSmartPointer&lt;vtkAppendFilter&gt;::New();</font></div><div><font face="courier new, monospace">    appender-&gt;SetInput(inputSurface);</font></div><div><font face="courier new, monospace">    appender-&gt;Update();</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">    // probe the volume with the surface</font></div><div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkProbeFilter&gt; probe =</font></div>

<div><font face="courier new, monospace">        vtkSmartPointer&lt;vtkProbeFilter&gt;::New();</font></div><div><font face="courier new, monospace">    probe-&gt;SetInput(appender-&gt;GetOutput());</font></div><div><font face="courier new, monospace">    probe-&gt;SetSource(volumeReader-&gt;GetOutput());</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">    // write the probed surface out</font></div><div><font face="courier new, monospace">    vtkSmartPointer&lt;vtkXMLUnstructuredGridWriter&gt; polyWirter =</font></div>

<div><font face="courier new, monospace">        vtkSmartPointer&lt;vtkXMLUnstructuredGridWriter&gt;::New();</font></div><div><font face="courier new, monospace">    polyWirter-&gt;SetInputConnection(probe-&gt;GetOutputPort());</font></div>

<div><font face="courier new, monospace">    polyWirter-&gt;SetFileName(&quot;/home/seth/Desktop/testProbe.vtu&quot;);</font></div><div><font face="courier new, monospace">    polyWirter-&gt;Write();</font></div><div><font face="courier new, monospace">}</font></div>

</div></div>