[vtkusers] VTK with OpenMP support and processing progress of filters?

David E DeMarle dave.demarle at kitware.com
Tue Feb 8 12:40:38 EST 2011


On Mon, Feb 7, 2011 at 8:22 PM, Ashika Umanga Umagiliya
<aumanga at biggjapan.com> wrote:
> Greetings all,
>
> I`ve got two questions.
> 1) Is it possible to compile VTK with OpenMP support ? (Does any of
> the filters/algorithms implemented with OpenMP support ? )

I'm not aware of any.

However, many imaging filters are internally multithreaded since it is
easiest to get the good speedups with regular data. Also note that
there is a threaded Executive, contributed by the SCI institute, which
can thread at the pipeline level.

See:
http://www.vtk.org/doc/nightly/html/classvtkThreadedImageAlgorithm.html
and
http://www.vtk.org/doc/nightly/html/classvtkThreadedStreamingPipeline.html

>
> 2) I have a filter chain as follows.I run this in a QT application.I
> want to get the progress of each filter.I know there is a method
> called GetProgress() , but is there anything like an "EventHandler"
> which triggers when the progress updated?
>

Do this by registering a callback to the Progress events sent by the filters.

See http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/FilterProgress

> Thanks in advance.
>
>
>
> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
>
> vtkSmartPointer<vtkPolyDataMapper> mapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
>
> vtkSmartPointer<vtkVoxelContoursToSurfaceFilter> contoursToSurface
> =vtkSmartPointer<vtkVoxelContoursToSurfaceFilter>::New();
>
>  contoursToSurface->SetInputConnection(appPoly->GetOutputPort());
>  contoursToSurface->SetSpacing(1, 1, 1);
>  contoursToSurface->GetOutput()->GetBounds(bm);
>
>
> vtkSmartPointer<vtkTriangleFilter> trianFilter =
> vtkSmartPointer<vtkTriangleFilter>::New();
>  trianFilter->SetInputConnection(contoursToSurface->GetOutputPort());
>
>
> vtkSmartPointer<vtkQuadricDecimation> quadDec =
> vtkSmartPointer<vtkQuadricDecimation>::New();
>  quadDec->SetTargetReduction(0.5);
>  quadDec->SetInputConnection(trianFilter->GetOutputPort());
>
>
> vtkSmartPointer<vtkSmoothPolyDataFilter> smooth =
> vtkSmartPointer<vtkSmoothPolyDataFilter>::New();
>  smooth->SetInputConnection(quadDec->GetOutputPort());
>  smooth->SetNumberOfIterations(smoothInter);
>  smooth->SetRelaxationFactor(smoothFac);
>  smooth->Update();
>
> mapper->AddInputConnection(smooth->GetOutputPort());
> _______________________________________________
> 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