[vtkusers] Fwd: Re:AW: vtkContourFilternotworkingonvtkStructuredGrid

Rakesh Patil rakeshthp at in.com
Fri Mar 12 07:28:51 EST 2010


 Well,What type of data is it..?? Is it a mesh or set of points..?? Why you want to set scalars for cell data..?? If you change this to set scalars to points it may work i guess.. Because, for me it works fine with points and only thing which comes in my mind is that, contour filter works only with point data and not cell data..Any way to make contour filter work with cell data guys..??ThanksRegardsRakesh Patil Original message From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de >Date: 12 Mar 10 16:35:42Subject:Re: [vtkusers] Fwd: Re:AW: vtkContourFilternotworkingonvtkStructuredGridTo: vtkusers I have checked it maybe a hundrert times. I have tried different ranges, different numbers of surfaces, GenerateValues(), SetValue() even different colors (in case it collides with thecolor).And yes maybe my data has some problem  but I have absolutley NO idea what kind of. The scalar data is properly displayed on a cutting plane, but I can't create iso surfaces.Am 12.03.2010 1
 1:59, schrieb Rakesh Patil: Try once again... Check code properly.. It should work.. else your data may be having some problem.. ThanksRegards Rakesh Patil Original message  From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de > Date: 12 Mar 10 15:57:21 Subject: Re: [vtkusers] Fwd: Re:AW: vtkContourFilter notworkingonvtkStructuredGrid To: vtkusers Yes. Of Course I tried that. Nothing changes.Am 12.03.2010 11:19, schrieb Rakesh Patil:Hi,Have you tried implementing what i told you.???scalarIsoSurface>GenerateValues( 10, sGrid>GetScalarRange() );this will solve your problem... As i told u before, there is no other prob i could figure out other than this.. GenerateValues takes three parameters, i.e.1. Number of contour lines, 2. min. value(of range) 3. max value(of range)It also takes two parameters.. in this case 2nd parameter is double array consisting two elements..ThanksRegards Rakesh Patil  Original message  From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de
  > Date: 12 Mar 10 15:40:22 Subject: Re: [vtkusers] Fwd: Re:AW: vtkContourFilter not workingonvtkStructuredGrid To: vtkusers Hi again.Attached you will find the code that should produce the iso surface, but displays nothing. I even tried to apply the vtkAssignAttribute frinxor at gmail.com suggested ... Nothing changes.Hope you will find the mistake. Have a nice day. SebastianAm 10.03.2010 15:50, schrieb Rakesh Patil:Well, i dont think anything is wrongAccording to this,http://www.vtk.org/doc/nightly/html/classvtkContourFilter.htmlvtkContourFilter is a filter that takes as input any dataset and generates on output isosurfaces and/or isolines. So that is not a problem..Can u just get you final code what u have coded..??ThanksRegards Rakesh Patil Original message  From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de > Date: 10 Mar 10 17:43:19 Subject: [vtkusers] Fwd: Re:AW: vtkContourFilter not working onvtkStructuredGrid To: vtkusers at vtk.orgNo, this doesn't work out. I pu
 t Update()'s at every (possible) object but nothing happens.Even chaning SetValue() and GenerateValues() doesn't change that. So maybe there is something wrong with the data?!I have a structured grid (called sGrid) and the scalar values are defined at the cell centers:sGrid>GetCellData()>SetScalars(T);But I just pass the sGrid to the vtkContourFilter vtkContourFilter *scalarIsoSurface vtkContourFilter::New(); scalarIsoSurface>SetInput(sGrid);May this be the problem?  OriginalNachricht Betreff: Re:AW: [vtkusers] vtkContourFilter not working on vtkStructuredGrid Datum: Sat, 06 Mar 2010 09:34:59 +0530 Von:Rakesh PatilAntwort an: Rakesh PatilAn:Sebastian Gatzka Hi Sebastian,I see there is a small mistake over there in your code..As far as my knowledge is concerned, scalarIsoSurface>GenerateValues(0,0.1);This statement should produce error. Coz, according to the documentation given herehttp://www.vtk.org/doc/release/5.4/html/a00323.htmlGenerateValues takes two parameters if and o
 nly if second parameter is a double array comprising of two elements min and max range.Even if this code executes without any error, then also no output will be produced, because the first argument you are passing is 0. First parameter tells the number of contours to be generated, Second parameter tells within what range these contours should be plotted.What i guess is, either you change it that statement t oscalarIsoSurface>SetValue(0, 0.1);orscalarIsoSurface>GenerateValues( n, sGrid>GetScalarRange() );where n is number of lines you want, say 1, 5, 10, 12... whatever...And then say update.. Am i correct David Sir..??Thanks RegardsRakesh Patil  Original message  From:"Sebastian Gatzka"< sebastian.gatzka at stud.tudarmstadt.de > Date: 05 Mar 10 22:50:50 Subject: AW: [vtkusers] vtkContourFilter not working on vtkStructuredGrid To: "'Rakesh Patil'"Hm. The >Update() did not work out. What can be wrong? How can the data be not fed correctly? Von: Rakesh Patil [mailto:rakeshthp at in.co
 m]Gesendet: Freitag, 5. M¤rz 2010 16:25 An: David Doria Cc: Sebastian Gatzka; vtkusers at vtk.org Betreff: Re: [vtkusers] vtkContourFilter not working on vtkStructuredGridYa, I had also done the same mistake... I had ommitted that update statement.. By putting that update statement is should definitley work.. (only if data is fed correctly) Original message  From:David Doria< daviddoria+vtk at gmail.com > Date: 05 Mar 10 19:26:03 Subject: Re: [vtkusers] vtkContourFilter not working on vtkStructuredGrid To: Sebastian GatzkaOn Fri, Mar 5, 2010 at 8:41 AM, Sebastian Gatzkawrote: Hello.I really can't tell why my code is not gernerating the isosurface. I have a structured grid (sGrid) filled with scalars.I call the contour filtervtkContourFilter *scalarIsoSurface vtkContourFilter::New(); scalarIsoSurface>SetInput(sGrid); scalarIsoSurface>GenerateValues(0,0.1);Compute the normalvtkPolyDataNormals *sGridPolyDataNormal vtkPolyDataNormals::New(); sGridPolyDataNormal>SetInput(scalarIsoSurf
 ace>GetOutput());Put them into a poly data mappervtkPolyDataMapper *scalarIsoSurfaceMapper vtkPolyDataMapper::New(); scalarIsoSurfaceMapper>SetInput(sGridPolyDataNormal>GetOutput());and into an actorvtkActor *scalarIsoSurfaceActor = vtkActor::New(); scalarIsoSurfaceActor>SetMapper(scalarIsoSurfaceMapper);which is passed on to the sceneren1>AddActor(scalarIsoSurfaceActor);and NOTHING happens.Any ideas what I have missed, or whats wrong?Sebastian You probably have a call to Render() after the code you sent us, which I believe updates the whole pipeline. Whenever I have something that is totally empty, I go back and put an Update() call on every object that is updatable. scalarIsoSurface>GenerateValues(0,0.1); scalarIsoSurface>Update(); before I dig too deep. If that doesn't change anything, try to create a demo involving some simple data (using a vtk*Source if you can, so we can reproduce it without needing your dataset). Then send us the smallest compilable code that demonstr
 ates the problem.Thanks, David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100312/1ef692c5/attachment.htm>


More information about the vtkusers mailing list