<br><br><blockquote><br>---------- Original message ----------<br>From:David Doria&lt; daviddoria+vtk@gmail.com &gt;<br>Date: 05 Jan 10 20:05:18<br>Subject:  Re: [vtkusers] vtkContourFilter produces no data as its output<br>To: rakeshthp@in.com<br><br>On Tue, Jan 5, 2010 at 12:19 AM, Rakesh Patil <rakeshthp@in.com> wrote:<br>&gt;<br>&gt;<br>&gt;<br>&gt; ---------- Original message ----------<br>&gt; From:David Doria&lt; daviddoria+vtk@gmail.com &gt;<br>&gt; Date: 04 Jan 10 19:10:45<br>&gt; Subject: Re: [vtkusers] vtkContourFilter produces no data as its output<br>&gt; To: rakeshthp@in.com<br>&gt;<br>&gt; On Mon, Jan 4, 2010 at 8:14 AM, Bill Lorensen wrote:<br>&gt;&gt; ContourFilter produces isosurfaces from the scalar data in a dataset.<br>&gt;&gt; Your unstructured grid has no scalar data as far as I can see.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On Mon, Jan 4, 2010 at 4:56 AM, Rakesh Patil wrote:<br>&gt;&gt;&gt; Hello there<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; After debugging for
  a long time, i found out that data exists till this<br>&gt;&gt;&gt; part<br>&gt;&gt;&gt; of code<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; vtkPoints *pts = vtkPoints::New();<br>&gt;&gt;&gt; pts-&gt;SetData(scatter_data); // scatter_data is an instance of<br>&gt;&gt;&gt; vtkDoubleArray<br>&gt;&gt;&gt; with three components<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; unsigned int num_ids = scatter_data-&gt;GetNumbe rOfTuples();<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; vtkPolyVertex *poly = vtkPolyVertex::New();<br>&gt;&gt;&gt; poly-&gt;GetPointIds()-&gt;SetNumberOfIds(num_ids);<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; for ( unsigned int i = 0; i &lt; num_ids; i++ )<br>&gt;&gt;&gt; poly-&gt;GetPointIds()-&gt;SetId(i,i);<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<br>&gt;&gt;&gt; ugrid-&gt;Allocate(1);<br>&gt;&gt;&gt; ugrid-&gt;InsertNextCell (poly-&gt;GetCellType(), poly-&gt;GetP ointIds());<br>&gt;&gt;&gt; ugrid-&gt;SetPoints(pts);<br>&gt;&gt;&gt;<br>&gt;
 &gt;&gt; vtkDelaunay2D *del = vtkDelaunay2D::New();<br>&gt;&gt;&gt; del-&gt;SetInput(ugrid);<br>&gt;&gt;&gt; del-&gt;SetTolerance(0.001);<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Once i execute, the following code,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; vtkContourFilter *cf = vtkContourFilter::New();<br>&gt;&gt;&gt; cf-&amp;g t;SetInputConnection(del-&gt;GetOutputPort());<br>&gt;&gt;&gt; cf-&gt;GenerateValues(10, -5, 20);<br>&gt;&gt;&gt; cf-&gt;Update();<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; all data vanishes..<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I mean to say that, initially, the grid had, 22,000 points.. After<br>&gt;&gt;&gt; traingulating, i got 20000 of cells..<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; But after executing the contour filter class, i get 0 cells and 0 points<br>&gt;&gt;&gt; as<br>&gt;&gt;&gt; output.. Where the data disappears all of a sudden, i'm not able to<br>&gt;&gt;&gt; understand.. Please i need a guidance from the most experienced and<br>&gt;&gt;&gt; senior<br>&gt;&gt;&gt; person.. M
 y mind is totally blank..<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thanks in advance<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Dear vtkusers ! Get Yourself a cool, short @in.com Email ID now!<br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Powered by <a target=\"_blank\" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt;&gt; <a target=\"_blank\" href="http://www.kitware.com/opensource/opensource.ht" target="_blank">http://www.kitware.com/opensource/opensource.ht</a> ml<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt;&gt;&gt; <a target=\"_blank\" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt;&gt;&gt;<br>&gt;<br>&gt; As Bill said, the vtkContourFilter does this:<br>&gt; <a target=\"_blank\" href="http://www.vtk.org/doc/nightly/html/cl
 assvtkContourFilter.html#_details" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html#_details</a><br>&gt;<br>&gt; Maybe you can come up with a very simple data set and describe exactly<br>&gt; what you are expecting to happen and maybe someone can point you to a<br>&gt; filter that does what you're looking for.<br>&gt;<br>&gt; Thanks,<br>&gt;<br>&gt; David<br>&gt; _______________________________________________<br>&gt;<br>&gt;<br>&gt; See basically, i have a file containing lat, lon and depth/bathymetry<br>&gt; values. I read them in the form x, y and z<br>&gt; as a sample file, it looks like this:<br>&gt;<br>&gt; 71.2632 18.2712 -5<br>&gt; 71.7762 18.6542 -5<br>&gt; 72.1262 18.2735 -3.5<br>&gt; 73.2123 19.6235 10<br>&gt; 71.2612 18.2756 5.5<br>&gt; 73.1122 19.7625 10<br>&gt; ...<br>&gt; ...<br>&gt; ...<br>&gt;<br>&gt; it go es upto thousands of lines like this... so, based on the z<br>&gt; (depth/bathymetry) values, i need to display contours..<
 br>&gt;<br>&gt; So any ideas how to go about for this..??<br>&gt;<br><br>So you don't really have multiple height contours, right? You just<br>have a "height map" or "terrain map". Take a look at this example:<br>http://www.cmake.org/Wiki/VTK/Examples/Filtering/Delaunay2D<br><br>It generates data like you have and then makes a surface on the<br>points. Let us know if that is what you're looking for.<br><br>Thanks,<br><br>David<br><br>Hi.. <br><br>Not exactly.. The output what i want is like the one which is produced by<br><br>vtk_source/examples/ImageProcessing/Tcl/Contours2D.tcl<br><br>in the vtksource directory..<br><br>However, the input formats remains same.. <br><br>As pointer out by Bill, <br></rakeshthp@in.com>&gt;&gt; ContourFilter produces isosurfaces from the scalar data in a dataset.<br>&gt;&gt; Your unstructured grid has no scalar data as far as I can see.<br><br>in my case the z values can be treated as scalar values.<br><br>One more thing, what do i do to reply
  the thread..?? I mean now i replied, it <br>comes as a new thread.. I want my reply to come under your reply.. How do i do that..??<br><br><br>Thanks<br><rakeshthp@in.com><br></rakeshthp@in.com></blockquote> <br><br><div style="border-top:1px dashed #ccc; border-bottom:1px dashed #ccc; padding:5px;"><a href="http://mail.in.com/mails/new_reg.php?utm_source=invite&utm_medium=outgoing" style="font:13px arial; color:#1E56A1; text-decoration:none;">Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>