Dear VTK Users,<br><br>I am trying to do something that seems to be very simple. The user drags around their vtkContourWidget, and I would like to be able to generate a mask based on their selection. A mask would simply mean that the closed area that the user defines would be black, and everything else would be intact.<br>
<br>I have tried many ways to do this, but they have either been too slow, or unsuccessful. First I used Delaunay2D to generate a surface from the closed contour. Then I looped through the image and used a CellLocator to check if each pixel was inside the surface. This worked, but it was dreadfully slow--on the order of seconds for a 512x512 image. Secondly I tried using the <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Imaging/vtkLassooStencilSource.h;h=5e88f891edf5b983b118cab19d9c008253e21ea3;hb=df58dd14">vtkLassooStencilSource</a>, which was designed for this, but it was also slow--took me nearly 200ms for a 512x512 image. Thirdly, I converted my vtkContourWidgetRepresentation into a vtkPolyData, and I was going to use my own simple algorithm that traverses each scanline to make the mask. However, the vtkPoints I retrieved from the vtkPolyData were not dense enough--I needed a point for every pixel in the Y direction (every scanline), and it did not provide enough.<br>
<br>If you have any thoughts or suggestions, I would greatly appreciate it.<br><br>-George<br>