[vtkusers] performance issue
David Gobbi
david.gobbi at gmail.com
Wed Feb 23 17:26:00 EST 2011
Even 5s seems like a very long time for an operation like this. My
guess is still that vtkImplicitDataSet is the main cause of slowness,
because it's Evaluate method is very expensive and is be called for
every voxel in the image when the stencil is generated. It is
possible that some changes to VTK between 4.2 and 5.6 have made
Evaluate even more expensive than it used to be.
I recommend that instead of using implicit functions, you do the following:
1) use vtkDataSetSurfaceFilter to generate a polydata surface for your element
2) use vtkPolyDataToImageStencil to create a stencil from that surface
The vtkPolyDataToImageStencil filter is much faster than
vtkImplicitFunctionToImageStencil, especially for 3D data.
Let me know how it goes.
- David
On Wed, Feb 23, 2011 at 2:29 PM, vlibertiaux <vlibertiaux at gmail.com> wrote:
>
> Hello David,
>
> the original image is 820*830*215, the clipped image is about 150*250*50.
>
> The original code (http://codepad.org/DGSZU6XH) indeed used
> vtkImplicitFunctionToImageStencil and vtkImplicitDataSet.
>
> For some reason, it is not working anymore with vtk5.6 (the DeepCopy in line
> 47 is not properly executed), that's why I rewrote it using vtkImageReslice.
>
> This part of the code executed in less than 5s in the original version and
> now takes 18s.
>
> V.
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/performance-issue-tp3397693p3397744.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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