[vtkusers] Slow vtkPolyDataToImageStencil

David Gobbi david.gobbi at gmail.com
Thu May 15 06:32:15 EDT 2008


Hi Marius,

You have to tell vtkPolyDataToImageStencil what OutputWholeExtent to
use, otherwise it will generate the largest possible output extent.

The easiest way to do this (in VTK 5.2 and VTK cvs) is to use the
SetInformationInput() method to specify a vtkImageData that has the
same extent that you want vtkPolyDataToImageStencil to use.  The other
way is to call SetOutputWholeExtent() to set the extent manually.  See
the doxygen page for a full description of how to use these methods.

   David


On Thu, May 15, 2008 at 4:30 AM, Marius Erdt <marius.erdt at gmx.de> wrote:
> Hi,
>
> I'm using the vtkPolyDataToImageStencil Filter to convert a polyData mesh
> into vtkImageStencilData which I want to use to mask an area in another
> volume.
> However, the filter takes a large amount of time to run (> 25 minutes on a
> Quad 6600 2,4 GHz). The mesh itself is the result of VTK marching cubes and
> is not very complex (one konvex object).
>
> Below is the code fragment I took from this list for the conversion.
>
> Thanks for any help,
>
> Marius
>
>       vtkPolyDataNormals * normalsFilter = vtkPolyDataNormals::New();
>       normalsFilter->SetInput( polyData );
>       normalsFilter->SetFeatureAngle(50);
>       normalsFilter->SetConsistency(1);
>       normalsFilter->SetSplitting(1);
>       normalsFilter->SetFlipNormals(0);
>       normalsFilter->Update();
>
>       vtkPolyDataToImageStencil * surfaceConverter =
> vtkPolyDataToImageStencil::New();
>       surfaceConverter->SetInput( normalsFilter->GetOutput() );
>       surfaceConverter->SetTolerance( 0.0 );
>       surfaceConverter->Update();
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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