[vtkusers] vtkMarchingCubes->vtkSmoothPolyDataFilter->vtkCurvatures

lynx.abraxas at freenet.de lynx.abraxas at freenet.de
Mon Jun 21 12:45:19 EDT 2010


Hello Liam,


I'm   not   an  expert  but  You  could  try  with  different  smoothers  like
WindowedSyncPolydataFilter. For that I know that  You  should  set  the  #  of
iterations  higher  (around  50)  and I don't think that for gaussian blobs it
makes sense to use a FeatureAngle.
Concerning the curvature filter You might be better of with  setting  a  local
reagion (bigger than the voxel size) in which the curvature is evaluated. That
way You might not need any smoothing at all if Your  blobs  are  sampled  fine
enough.  However  I'm  not  sure  if  vtkCurvatures allows to set such a local
reagion (I might have seen it in ITK).

It would be nice to report back when You got it working nicely.

Hope this is of any help
Lynx



On 21/06/10 17:01:52, Liam Kurmos wrote:
> I'm trying to implement this sequence of filters on some 3d gaussian blobs.
> vtkMarchingCubes->vtkSmoothPolyDataFilter->vtkCurvatures
> 
> First I tried without smoothing but then the vtkCurvatures seemed to
> be picking out artifact from the marchingCubes that were not in the
> implicit gaussians. I had partial success with smoothing (screen shots
> attached) though still some a-symmetric artifacts persist.
> 
> The greatest problem is that apparently flat areas of the surface are
> being coloured the same dark blue as highly curved features implying
> this is not working. Although some feature do get the right general
> indication of colour (such as when i drop the isovalue enough that a
> flat region becomes flat enough it starts to turn green. However as
> can be seen in the screen shots, even fairly flat areas are coloured
> blue. (there are 2 disks, 2 small and 1 large blobs in the dataset)
> 
> I'm pasting my code below, any advice on what im doing wrong here
> would be very much appreciated.
> 
> Liam
> 
> ..........
> 
> iso = vtkMarchingCubes::New();
>     iso->SetInput(vol);
>     iso->SetNumberOfContours(1);
>     iso->SetValue(0, 0);
>     iso->Update();
> 
>     vtkPolyDataNormals *surfNormals = vtkPolyDataNormals::New();
>     surfNormals->SetInputConnection(iso->GetOutputPort());
>     surfNormals->SetFeatureAngle(60.0);
> 
>     vtkSmartPointer<vtkSmoothPolyDataFilter> smoothFilter =
>             vtkSmartPointer<vtkSmoothPolyDataFilter>::New();
>     smoothFilter->SetInputConnection(surfNormals->GetOutputPort());
>     smoothFilter->SetNumberOfIterations(5);
>     smoothFilter->SetRelaxationFactor(0.85);
>     smoothFilter->SetFeatureAngle(70);
>     smoothFilter->FeatureEdgeSmoothingOn();
>     smoothFilter->BoundarySmoothingOn();
>     smoothFilter->Update();
> 
>     vtkCurvatures *curv = vtkCurvatures::New();
>     curv->SetInputConnection(smoothFilter->GetOutputPort());
>     curv->SetCurvatureTypeToMean();
> 
>    //added this lookup table seems to have no affect.
>     vtkLookupTable* lut = vtkLookupTable::New();
>     lut->SetHueRange(0.0, 0.6); //Red to Blue
>     lut->SetAlphaRange(1.0, 1.0);
>     lut->SetValueRange(1.0, 1.0);
>     lut->SetSaturationRange(1.0, 1.0);
>     lut->SetNumberOfTableValues(256);
>     lut->SetRange(-100, 100);
>     lut->Build();
> 
> 
>     vtkPolyDataMapper *polyMap2 = vtkPolyDataMapper::New();
>     polyMap2->SetLookupTable(lut);
>     polyMap2->SetInputConnection(curv->GetOutputPort());
> 
>     contourActor = vtkActor::New();
>     contourActor->SetMapper(polyMap2);
>     polyMap2->GetInput()->Update();
> 
>     iso->Delete();




> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list