Hi David,<br><br>Yours is probably the quickest reply I&#39;ve got so far through this list. Thanks again! Now I know how vtkProbeFilter works. Looks like I have to figure out a way to interpolate my data outside VTK. I am considering getting all the data available and then use vtkImageReslice, since it provides several choices of interpolation method. 
<br><br>Could you explain a little bit of the Matrices for axial, coronal, sagittal, oblique view orientations part in your example code?<span style="font-family: monospace;"><br><br></span>//static double axialElements[16] = {
<br><pre>  //         1, 0, 0, 0,<br>  //         0, 1, 0, 0,<br>  //         0, 0, 1, 0,<br>  //         0, 0, 0, 1 };<br><br>  //static double coronalElements[16] = {<br>  //         1, 0, 0, 0,<br>  //         0, 0, 1, 0,
<br>  //         0,-1, 0, 0,<br>  //         0, 0, 0, 1 };<br><br>  static double sagittalElements[16] = {<br>           0, 0,-1, 0,<br>           1, 0, 0, 0,<br>           0,-1, 0, 0,<br>           0, 0, 0, 1 };<br><br>  //static double obliqueElements[16] = {
<br>  //         1, 0, 0, 0,<br>  //         0, 0.866025, -0.5, 0,<br>  //         0, 0.5, 0.866025, 0,<br>  //         0, 0, 0, 1 };<br></pre><br><div><span class="gmail_quote">I don&#39;t quite understand the four different view orientations. Last time I tried axial view and got the first image in my email. I got a blank scene with other view orientations.
<br><br>Thanks,<br>Janny<br><br>On 6/14/07, <b class="gmail_sendername">David Gobbi</b> &lt;<a href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Janny,<br><br>You can avoid the second triangularization if you use vtkPlaneSource to<br>create the polydata that you probe your original points with.&nbsp;&nbsp;The<br>SetXResolution and SetYResolution methods of vtkPlaneSource set the
<br>number of &quot;squares&quot; that the plane is divided into in X and Y.&nbsp;&nbsp;The<br>number of points along each edge is equal to the resolution plus one.<br><br>The reason that you weren&#39;t seeing anything is that you have to generate
<br>polygons from the points before they can be rendered (unless you render<br>them as verts, in which case the points are just rendered as points).<br><br>The single color for the &quot;outside&quot; is there because of the way that
<br>vtkProbeFilter works.&nbsp;&nbsp;It can only do interpolation within the triangles<br>produced by the triangularization, everything outside is set to a<br>background color.&nbsp;&nbsp;To properly fill in these values you would have to do
<br>your interpolation using something like radial basis functions or with a<br>relaxation method, neither of which is supported in VTK.<br><br> - David<br><br><br><br>Janny Dong wrote:<br>&gt; Hey David,<br>&gt;<br>&gt; Thank you so much. I tried the vtkDelaunay2D then vtkProbeFilter
<br>&gt; approach you suggested. What I did is use vtkDelaunay2D to triangulate<br>&gt; a polydata set of 16 points with known scalars, then probe it with<br>&gt; another polydata set of 36 points, then use vtkDelaunay2D again and
<br>&gt; map the output to polydata mapper and display them. I got Image1 as<br>&gt; attached. I did triangulation again because the render window was<br>&gt; blank if I map output of vtkProbeFilter directly to polydata mapper. I
<br>&gt; may have done something wrong.<br>&gt;<br>&gt; Another thing is if the known data points are not evenly distributed,<br>&gt; I got Image2, where all known 16 data are at the bottom left area.<br>&gt; The area outside the known data values was interpolated as one color.
<br>&gt; Is it normal that the data outside the 4*4 area got the same scalar<br>&gt; value?<br>&gt;<br>&gt; Thanks,<br>&gt; Janny<br>&gt;<br>&gt;<br>&gt; On 6/13/07, *David Gobbi* &lt; <a href="mailto:dgobbi@atamai.com">dgobbi@atamai.com
</a><br>&gt; &lt;mailto:<a href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi Janny,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; If your original data points do not form a complete, regular grid,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; then
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; vtkImageReslice won&#39;t give you the result you want.&nbsp;&nbsp;You can&#39;t use<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; vtkImageReslice to fill in the gaps.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Instead, you could try using vtkDelaunay2D to triangularize the data
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; followed by vtkProbeFilter to interpolate the data.&nbsp;&nbsp;A limitation of<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ProbeFilter is that it always does linear interpolation, and it cannot<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; interpolate beyond the hull of the original set of points.
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; - David<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Janny Dong wrote:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I am trying to get a color contour map out of several data points.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Let&#39;s say, I need a nice and smooth 2D color map of dimension
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 5*5, so<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; that&#39;s 25 points. I know the positions of the points of course,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; but I<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; only know 10 data values (scalars). Therefore I need some<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; interpolation to get to know data values (scalars) at all positions
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; and map them to colors.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I put my data into ImageData, and I am using ImageReslice in<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; order to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; do the interpolation I want. I constructed pipelines following the
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; example David Gobbi provided at<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain">
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain">
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; &lt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain">
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain">
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/ImageProcessing/Cxx/ImageSlicing.cxx?root=VTK&amp;content-type=text/plain</a>&gt;&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Then I got an image as attached. For now, I just input 10 random
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; scalar values to 10 positions. I used cubic interpolation. What<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I want<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; is interpolation over the whole image area, not just near every<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; point.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; How can I achieve such visualization effect?
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Actually I just tried everything to get the visualization effect<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; from<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; the Matlab functions griddata, which fits a surface of the form z =<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; f(x,y) to the data in the (usually) nonuniformly spaced vectors
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; (x,y,z), but I couldn&#39;t find a way in VTK to do the interpolation. I<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; read from Matlab help document that the griddata methods (nearest<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; neighbor, cubic, linear) are based on a Delaunay triangulation
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; of the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; data that uses Qhull. However I have no experience with Qhull<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; and not<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; much time to dig into it. Also, I have to do the project in C++ not<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Matlab. VTK is such a powerful visualization tool so I hope I
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; could do<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; it with VTK.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Thanks a lot.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Janny<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ------------------------------------------------------------------------
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ------------------------------------------------------------------------<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; _______________________________________________<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; This is the private VTK discussion list.
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Please keep messages on-topic. Check the FAQ at:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a> &lt;<a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ
</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Follow this link to subscribe/unsubscribe:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------
<br>&gt;<br><br></blockquote></div><br>