[vtkusers] Problem with vtkSmoothPolyDataFilter

Alex Malyushytskyy alexmalvtk at gmail.com
Fri Mar 2 19:41:00 EST 2012


Thank you for sharing what you are doing with us!
Special thanks for doing twice!
Since you have not asked any question I guess you do not experience any problem
and just want to hear how good your code was.

Regards,

Alex


On Thu, Mar 1, 2012 at 10:54 PM, Darshan Pai <darshanpai at gmail.com> wrote:
> 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);
>
>
> _______________________________________________
> 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