[vtkusers] How to use 'vtkCurvatures' class?

Amy Squillacote ahs at cfdrc.com
Mon Oct 20 14:14:39 EDT 2008


vtkUnstructuredGridToPolyDataFilter is an abstract class; you can't 
instantiate it. Instead, do one of the two things I described in my 
previous email after the vtkThresholdFilter.

1) vtkGeometryFilter *geom = vtkGeometryFilter::New();
    geom->SetInput(thresh->GetOutput());

    maxMapper->SetInput(geom->GetOutput());

2) Replace vtkPolyDataMapper with vtkDataSetMapper, as shown below.
    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
    mapper->SetInput(thresh->GetOutput());

    actor->SetMapper(mapper);


- Amy

B. C. wrote:
> Hi,
> I used this:
>  
> vtkCurvatures *curve = vtkCurvatures::New();
> curve->SetInput(cleaner->GetOutput());
> curve->SetCurvatureTypeToMaximum();
> curve->Update();
>  
> vtkThreshold *thresh = vtkThreshold::New();
> thresh->SetInput(curve->GetOutput());
> thresh->ThresholdByUpper(0.5);
>  
> vtkUnstructuredGridToPolyDataFilter *filtre;
> filtre->SetInput(thresh->GetOutput());
>   
> vtkPolyDataMapper *maxMapper = vtkPolyDataMapper::New();
> maxMapper->SetInput(filtre->GetOutput());
>  
> but, that does not work. The bug generated is in this line:
> filtre->SetInput(thresh->GetOutput());
>  
> I don't know how to do!!!!
>  
>
> --- En date de : *Lun 20.10.08, Amy Squillacote /<ahs at cfdrc.com>/* a 
> écrit :
>
>     De: Amy Squillacote <ahs at cfdrc.com>
>     Objet: Re: [vtkusers] How to use 'vtkCurvatures' class?
>     À: butterfly.1688 at yahoo.fr
>     Cc: vtkusers at vtk.org
>     Date: Lundi 20 Octobre 2008, 13h03
>
>     Add a vtkGeometryFilter between vtkThreshold and vtkPolyDataMapper OR 
>     use a vtkDataSetMapper instead of the vtkPolyDataMapper (in which case 
>     vtkGeometryFilter is unneeded).
>
>     - Amy
>
>     B. C. wrote:
>     > Hi Amy,
>     > when i do what you told me, i have this error:
>     > error C2664: 'SetInput' : cannot convert parameter 1 from
>     'class 
>     > vtkUnstructuredGrid *' to 'class vtkPolyData'
>     > for the code line
>     'maxMapper->SetInput(thresh->GetOutput());'
>     > It should be something else to add before this. Can you help me?
>     >
>     >
>     > --- En date de : *Ven 17.10.08, Amy Squillacote /<ahs at cfdrc.com>/* a
>
>     > écrit :
>     >
>     >     De: Amy Squillacote <ahs at cfdrc.com>
>     >     Objet: Re: [vtkusers] How to use 'vtkCurvatures' class?
>     >     À: butterfly.1688 at yahoo.fr
>     >     Cc: vtkusers at vtk.org
>     >     Date: Vendredi 17 Octobre 2008, 20h12
>     >
>     >     Put the vtkThreshold code after you set up vtkCurvatures (just below 
>     >     your call to curve->Update()). Then change the input to maxMapper
>     from 
>     >     "curve->GetOutput()" to
>     "thresh->GetOutput()".
>     >
>     >     - Amy
>     >
>     >     B. C. wrote:
>     >     > Thank you Amy.
>     >     > I post you the code i used:
>     >     >  
>     >     > vtkCurvatures *curve = vtkCurvatures::New();
>     >     > curve->SetInput(cleaner->GetOutput());
>     >     > curve->SetCurvatureTypeToMaximum();
>     >     > curve->Update();
>     >     >  
>     >     > vtkPolyDataMapper *maxMapper = vtkPolyDataMapper::New();
>     >     > maxMapper->SetInput(curve->GetOutput());
>     >     >  
>     >     > vtkActor *maxCurve = vtkActor::New();
>     >     > maxCurve->SetMapper(maxMapper);
>     >     > maxCurve->SetPosition(0.0,0.0,0.0);
>     >     > myRender->AddActor(maxCurve);
>     >     > myRenderWindow->Render();
>     >     >  
>     >     > Please, tell me where to add the code you sent to me to display
>     the 
>     >     > maximum curvatures>0.5
>     >     >  
>     >     > Thank you for your help!!!
>     >     >
>     >     >
>     >     > --- En date de : *Ven 17.10.08, Amy Squillacote
>     /<ahs at cfdrc.com>/* a
>     >
>     >     > écrit :
>     >     >
>     >     >     De: Amy Squillacote <ahs at cfdrc.com>
>     >     >     Objet: Re: [vtkusers] How to use 'vtkCurvatures'
>     class?
>     >     >     À: butterfly.1688 at yahoo.fr
>     >     >     Cc: vtkusers at vtk.org
>     >     >     Date: Vendredi 17 Octobre 2008, 19h41
>     >     >
>     >     >     You'll want to use vtkCurvatures with curvature type set
>     to
>     >     maximum. 
>     >     >     Then pass the output of that filter to a vtkThreshold, using
>     the 
>     >     >     ThresholdByUpper method to indicate the values to keep.
>     Example c++
>     >     code 
>     >     >     is shown below.
>     >     >
>     >     >     vtkCurvatures *curv = vtkCurvatures::New();
>     >     >     curv->SetCurvatureTypeToMaximum();
>     >     >
>     >     >     vtkThreshold *thresh = vtkThreshold::New();
>     >     >     thresh->SetInputConnection(curv->GetOutputPort());
>     >     >     thresh->ThresholdByUpper(0.5); // using the example value
>     you
>     >     provided.
>     >     >
>     >     >     Online documentation for vtkCurvatures is here: 
>     >     >     http://www.vtk.org/doc/nightly/html/classvtkCurvatures.html.
>     >     >     Online documentation for vtkThreshold is here: 
>     >     >     http://www.vtk.org/doc/nightly/html/classvtkThreshold.html.
>     >     >
>     >     >     - Amy
>     >     >
>     >     >     B. C. wrote:
>     >     >     > Please, i need your help to finish my work!!!
>     >     >     > I use 'vtkCurvatures' to compute curvatures at
>     each point
>     >     of my 
>     >     >     > polydata structure.
>     >     >     > I want to save only the Maximum curvatures and display
>     only those
>     >
>     >     >     > which are > some_value (0.5 for example).
>     >     >     > Can someone tell me how to do this?
>     >     >     > Please heeeeeeeeelp!!!
>     >     >     >
>     >     >     >
>     >     >     > __________________________________________________
>     >     >     > Do You Yahoo!?
>     >     >     > En finir avec le spam? Yahoo! Mail vous offre la
>     meilleure
>     >     protection 
>     >     >     > possible contre les messages non sollicités
>     >     >     > http://mail..yahoo.fr Yahoo! Mail
>     >     >     >
>     >    
>     ------------------------------------------------------------------------
>     >     >     >
>     >     >     > _______________________________________________
>     >     >     > This is the private VTK discussion list.
>     >     >     > Please keep messages on-topic. Check the FAQ at:
>     >     >     http://www.vtk.org/Wiki/VTK_FAQ
>     >     >     > Follow this link to subscribe/unsubscribe:
>     >     >     > http://www.vtk.org/mailman/listinfo/vtkusers
>     >     >     >   
>     >     >
>     >     >     -- 
>     >     >     Amy Squillacote                    Phone: (256) 726-4839
>     >     >     Computer Scientist                 Fax: (256) 726-4806
>     >     >     CFD Research Corporation           Web: http://www.cfdrc.com
>     >     >     215 Wynn Drive, Suite 501
>     >     >     Huntsville, AL  35805
>     >     >
>     >     >
>     >     >               
>     >     >
>     >     >
>     >     > __________________________________________________
>     >     > Do You Yahoo!?
>     >     > En finir avec le spam? Yahoo! Mail vous offre la meilleure
>     protection 
>     >     > possible contre les messages non sollicités
>     >     > http://mail.yahoo.fr Yahoo! Mail 
>     >
>     >     -- 
>     >     Amy Squillacote                    Phone: (256) 726-4839
>     >     Computer Scientist                 Fax: (256) 726-4806
>     >     CFD Research Corporation           Web: http://www.cfdrc.com
>     >     215 Wynn Drive, Suite 501
>     >     Huntsville, AL  35805
>     >
>     >
>     >               
>     >
>     >
>     > __________________________________________________
>     > Do You Yahoo!?
>     > En finir avec le spam? Yahoo! Mail vous offre la meilleure protection 
>     > possible contre les messages non sollicités
>     > http://mail.yahoo.fr Yahoo! Mail 
>
>     -- 
>     Amy Squillacote                    Phone: (256) 726-4839
>     Computer Scientist                 Fax: (256) 726-4806
>     CFD Research Corporation           Web: http://www.cfdrc.com
>     215 Wynn Drive, Suite 501
>     Huntsville, AL  35805
>
>
>               
>
>
> __________________________________________________
> Do You Yahoo!?
> En finir avec le spam? Yahoo! Mail vous offre la meilleure protection 
> possible contre les messages non sollicités
> http://mail.yahoo.fr Yahoo! Mail 

-- 
Amy Squillacote                    Phone: (256) 726-4839
Computer Scientist                 Fax: (256) 726-4806
CFD Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805





More information about the vtkusers mailing list