[vtkusers] vtkContourFilter produces no data as its output

Rakesh Patil rakeshthp at in.com
Fri Jan 8 00:18:22 EST 2010


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


More information about the vtkusers mailing list