[vtkusers] Fwd: Problem with vtksmoothPolyDataFilter

Vincent LEFORT vincent.lefort at aquilab.com
Wed Apr 25 03:43:39 EDT 2012


Hi, I have the same problem,

I want to smooth isolines extracted from vtkMarchingContourFilter (with the help of vtkImageReslice before) but vtkSmoothPolyDataFilter don't work... (or I missuse it).

The goal is to avoid this display effect :
[cid:image001.png at 01CD22C7.E4329950]

Anyone has an idea of how to use a smooth filter on an isoline ?

Regards,

Vincent LEFORT

De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Darshan Pai
Envoyé : mardi 10 avril 2012 21:18
À : pj gouttenoire
Cc : vtkusers at vtk.org
Objet : Re: [vtkusers] Fwd: Problem with vtksmoothPolyDataFilter

Even with your setup it does not work .
On Tue, Apr 10, 2012 at 4:27 AM, pj gouttenoire <goutteno at esrf.fr<mailto:goutteno at esrf.fr>> wrote:
i used vtkSmoothPolyDataFilter like this and it works.

    // Lissage de la surface
   vtkSmartPointer< vtkSmoothPolyDataFilter> smoothFilter = vtkSmartPointer<vtkSmoothPolyDataFilter>::New();
    smoothFilter->SetInput(isor->GetOutput());
    smoothFilter->SetNumberOfIterations(nbIteration);
    smoothFilter->SetRelaxationFactor(relFactor);
    smoothFilter->SetConvergence(convergence);
    smoothFilter->BoundarySmoothingOff ();
    smoothFilter->Update();


Le 06/04/2012 23:34, Darshan Pai a écrit :
I still could not find debug this problem , pushing it up once again .
---------- Forwarded message ----------
From: Darshan Pai <darshanpai at gmail.com<mailto:darshanpai at gmail.com>>
Date: Fri, Mar 2, 2012 at 2:03 AM
Subject: Problem with vtksmoothPolyDataFilter
To: vtkusers at vtk.org<mailto:vtkusers at vtk.org>


Hello All,

I have been moving some of my old projects which are on VTK4.4 onto the new VTK nightly build .
Following is the code I am using

vtkSmartPointer<
vtkImageThreshold> renderThreshold = vtkSmartPointer<vtkImageThreshold>::New();
        renderThreshold->ThresholdBetween(0, 0);
        renderThreshold->SetInValue(0);
        renderThreshold->SetOutValue(1);
        renderThreshold->SetInput(ribbonsurface);

        vtkSmartPointer<vtkImageIslandRemoval2D> renderIslandRemoval2D1 = vtkSmartPointer<vtkImageIslandRemoval2D>::New();
        renderIslandRemoval2D1->SetInputConnection(renderThreshold->GetOutputPort());
        renderIslandRemoval2D1->SetAreaThreshold(100);
        renderIslandRemoval2D1->SetIslandValue(1);
        renderIslandRemoval2D1->SetReplaceValue(0);

        vtkSmartPointer<vtkImageIslandRemoval2D> renderIslandRemoval2D2 = vtkSmartPointer<vtkImageIslandRemoval2D>::New();
        renderIslandRemoval2D2->SetInputConnection(renderIslandRemoval2D1->GetOutputPort());
        renderIslandRemoval2D2->SetAreaThreshold(100);
        renderIslandRemoval2D2->SetIslandValue(0);
        renderIslandRemoval2D2->SetReplaceValue(1);

        vtkSmartPointer<vtkImageContinuousErode3D> renderContinuousErode3D = vtkSmartPointer<vtkImageContinuousErode3D>::New();
        renderContinuousErode3D->SetInputConnection(renderIslandRemoval2D2->GetOutputPort());
        renderContinuousErode3D->SetKernelSize(3, 3, 3);

        vtkSmartPointer<vtkImageContinuousDilate3D> renderContinuousDilate3D = vtkSmartPointer<vtkImageContinuousDilate3D>::New();
        renderContinuousDilate3D->SetInputConnection(renderContinuousErode3D->GetOutputPort());
        renderContinuousDilate3D->SetKernelSize(4, 4, 4);

        vtkSmartPointer<vtkContourFilter> renderContourFilter = vtkSmartPointer<vtkContourFilter>::New();
        renderContourFilter->SetInputConnection(renderContinuousDilate3D->GetOutputPort());
        renderContourFilter->SetValue(0,1);

        vtkSmartPointer<vtkSmoothPolyDataFilter> renderSmoothPolyDataFilter = vtkSmartPointer<vtkSmoothPolyDataFilter>::New();
        renderSmoothPolyDataFilter->SetInputConnection(renderContourFilter->GetOutputPort());
        renderSmoothPolyDataFilter->SetNumberOfIterations(20);
        renderSmoothPolyDataFilter->SetRelaxationFactor(0.15);
        renderSmoothPolyDataFilter->SetFeatureAngle(40);
        renderSmoothPolyDataFilter->FeatureEdgeSmoothingOff();
        renderSmoothPolyDataFilter->BoundarySmoothingOff();
        renderSmoothPolyDataFilter->SetConvergence(0);
        renderSmoothPolyDataFilter->Update();

        vtkSmartPointer<vtkPolyDataMapper> ribbonpolydata = vtkSmartPointer<vtkPolyDataMapper>::New();
        ribbonpolydata->SetInputConnection(renderSmoothPolyDataFilter->GetOutputPort());

        ribbonactor = vtkSmartPointer<vtkActor>::New();
        ribbonactor->SetMapper(ribbonpolydata);

I have attached the output . It looks as if everything up until the rendercontourFilter generates the exact same output in VTK 4.4 and the current VTK

But when I introduce the vtkSmoothPolyDataFilter , the output does not change . There is no smoothing on the polydata .

I cannot seem to pinpoint the problem . Hope someone can help

Regards
Darshan




_______________________________________________

Powered by www.kitware.com<http://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


_______________________________________________
Powered by www.kitware.com<http://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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120425/930f635d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 45552 bytes
Desc: image001.png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120425/930f635d/attachment.png>


More information about the vtkusers mailing list