[Insight-developers] The quest for a fast polygon set to binary image filter.

Dan Mueller dan.muel at gmail.com
Fri Aug 7 02:18:53 EDT 2009


Hi Kent,

The below document concisely describes the active edge table scanline
conversion method (which the GraphicsGems code implements).

"The Simplicity of Complex Polygons",
Michael Abrash, Dr. Dobb's Journal June 1991, v16, n6, p139(6).
http://downloads.gamedev.net/pdf/gpbb/gpbb40.pdf

HTH

Cheers, Dan

2009/8/6 kent williams <norman-k-williams at uiowa.edu>:
> Before I start on this has anyone else had a crack at this problem?
>
> I want to generate a mask image from as set of polygons (generated by
> BRAINSTracer).  Currently what I do is basically
>
> for each polygon
>  find bounds of polygon
>  for each voxel in bounds
>    if voxel's position is inside the polygon then
>      voxel = 255
>    else
>      voxel = 0
>    endif
>  endfor
> endfor
>
> As you can imagine, this is not super speedy, especially since my polygons
> are derived (by vtkContourRepresentation) from a set of spline control
> points, so each test for polygon membership has to contend with potentially
> hundreds of vertices.
>
> I've spent most of today googling and trying things out before getting
> really frustrated.  What I have is a set of polygons, each of which lies on
> a 2D slice, and I want to generate a mask volume where every point inside
> any of the polygon is inside the mask.
>
> The best starting point I've found is this code from Graphics Gems:
> http://tog.acm.org/resources/GraphicsGems/gems/ConcaveScan.c
>
> This is pretty easily parallelizable on the per-slice level.
>
> But adapting this code is non-trivial for a number of reasons.  So has
> anyone else attacked this?
>
> I know about PolylineMask2DImageFilter and PolylineMaskImageFilter, but the
> former only works for convex polygons, and I can't figure out what the
> latter would do forme.
>
> _______________________________________________
> 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 ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list