<br><br><blockquote><br>---------- Original message ----------<br>From:David Doria< daviddoria+vtk@gmail.com ><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>><br>><br>><br>> ---------- Original message ----------<br>> From:David Doria< daviddoria+vtk@gmail.com ><br>> Date: 04 Jan 10 19:10:45<br>> Subject: Re: [vtkusers] vtkContourFilter produces no data as its output<br>> To: rakeshthp@in.com<br>><br>> On Mon, Jan 4, 2010 at 8:14 AM, Bill Lorensen wrote:<br>>> ContourFilter produces isosurfaces from the scalar data in a dataset.<br>>> Your unstructured grid has no scalar data as far as I can see.<br>>><br>>><br>>> On Mon, Jan 4, 2010 at 4:56 AM, Rakesh Patil wrote:<br>>>> Hello there<br>>>><br>>>> After debugging for
a long time, i found out that data exists till this<br>>>> part<br>>>> of code<br>>>><br>>>><br>>>> vtkPoints *pts = vtkPoints::New();<br>>>> pts->SetData(scatter_data); // scatter_data is an instance of<br>>>> vtkDoubleArray<br>>>> with three components<br>>>><br>>>> unsigned int num_ids = scatter_data->GetNumbe rOfTuples();<br>>>><br>>>> vtkPolyVertex *poly = vtkPolyVertex::New();<br>>>> poly->GetPointIds()->SetNumberOfIds(num_ids);<br>>>><br>>>> for ( unsigned int i = 0; i < num_ids; i++ )<br>>>> poly->GetPointIds()->SetId(i,i);<br>>>><br>>>> vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<br>>>> ugrid->Allocate(1);<br>>>> ugrid->InsertNextCell (poly->GetCellType(), poly->GetP ointIds());<br>>>> ugrid->SetPoints(pts);<br>>>><br>>
>> vtkDelaunay2D *del = vtkDelaunay2D::New();<br>>>> del->SetInput(ugrid);<br>>>> del->SetTolerance(0.001);<br>>>><br>>>> Once i execute, the following code,<br>>>><br>>>> vtkContourFilter *cf = vtkContourFilter::New();<br>>>> cf-&g t;SetInputConnection(del->GetOutputPort());<br>>>> cf->GenerateValues(10, -5, 20);<br>>>> cf->Update();<br>>>><br>>>> all data vanishes..<br>>>><br>>>> I mean to say that, initially, the grid had, 22,000 points.. After<br>>>> traingulating, i got 20000 of cells..<br>>>><br>>>> But after executing the contour filter class, i get 0 cells and 0 points<br>>>> as<br>>>> output.. Where the data disappears all of a sudden, i'm not able to<br>>>> understand.. Please i need a guidance from the most experienced and<br>>>> senior<br>>>> person.. M
y mind is totally blank..<br>>>><br>>>> Thanks in advance<br>>>><br>>>><br>>>><br>>>> Dear vtkusers ! Get Yourself a cool, short @in.com Email ID now!<br>>>> _______________________________________________<br>>>> Powered by <a target=\"_blank\" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>>>><br>>>> Visit other Kitware open-source projects at<br>>>> <a target=\"_blank\" href="http://www.kitware.com/opensource/opensource.ht" target="_blank">http://www.kitware.com/opensource/opensource.ht</a> ml<br>>>><br>>>> Please keep messages on-topic and check the VTK FAQ at:<br>>>> <a target=\"_blank\" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>>>><br>><br>> As Bill said, the vtkContourFilter does this:<br>> <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>><br>> Maybe you can come up with a very simple data set and describe exactly<br>> what you are expecting to happen and maybe someone can point you to a<br>> filter that does what you're looking for.<br>><br>> Thanks,<br>><br>> David<br>> _______________________________________________<br>><br>><br>> See basically, i have a file containing lat, lon and depth/bathymetry<br>> values. I read them in the form x, y and z<br>> as a sample file, it looks like this:<br>><br>> 71.2632 18.2712 -5<br>> 71.7762 18.6542 -5<br>> 72.1262 18.2735 -3.5<br>> 73.2123 19.6235 10<br>> 71.2612 18.2756 5.5<br>> 73.1122 19.7625 10<br>> ...<br>> ...<br>> ...<br>><br>> it go es upto thousands of lines like this... so, based on the z<br>> (depth/bathymetry) values, i need to display contours..<
br>><br>> So any ideas how to go about for this..??<br>><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>>> ContourFilter produces isosurfaces from the scalar data in a dataset.<br>>> 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>