[Insight-users] Re: Polygon Scan Converter

Benjamin King king.benjamin at mh-hannover.de
Wed Jun 15 08:19:59 EDT 2005


Hi Jim,

I finished the polygon scan conversion iterator. I followed your 
recommendation for initialization, renamed a few classes and methods as 
discussed, rewrote the test programm to mimic a regression test, and added 
more documentation and ITK stuff.

Feel free to integrate the code into ITK and contact me if you miss anything 
or find poorly documented sections.

cheers,
	Benjamin

> Benjamin,
>
> I am very interested in the polygon scan conversion iterator. I've been
> swamped lately.
>
> I would start with just providing a vector of indices to specify the
> polygon. I guess I would make one pass through the list of indices to
> determine which components of the indices do not change, thereby
> establishing the plane. Something like:
>
> std::vector<bool> constant(true, ImageDimension);
> std::vector<Index<ImageDimension> >::iterator it;
> it = poly.begin();
> firstIndex = *it;
> ++it;
> for (; it != poly.end(); ++it)
> {
>    Index<ImageDimension> index;
>    index = *it;
>
>    for (i=0; i < ImageDimension; ++i)
>    {
>    if (index[i] != firstindex[i])
>      {
>      constant[i] = false;
>      }
>    }
>
>    ++it;
> }
>
> // count the number of components that change across the polygon
> for (i=0, count=0; i < ImageDimension; ++i)
> {
>    if (!constant[i])
>       count++;
> }
>
> if (count > 2)
>    // Ugggh.  not a planar polygon
>
>
>
>
> -----Original Message-----
> From: Benjamin King [mailto:king.benjamin at mh-hannover.de]
> Sent: Monday, June 13, 2005 4:02 AM
> To: Miller, James V (Research)
> Subject: Polygon Scan Converter
>
>
> Hi Jim,
>
> are you still interested in the polygon scan conversion iterator? I could
> finish the job and make it work on an arbitrary, axis aligned plane, but I
> need some input on the preferred way to initialize the iterator.
>
> I described two alternative method in my last post, choose one and I'll
> implement it =)
>
> 	http://public.kitware.com/pipermail/insight-users/2005-June/013535.html
>
> Cheers,
> 	Benjamin

-- 
Benjamin King
Experimentelle Radiologie
Medizinische Hochschule Hannover
Tel.: +49  511  532-2663
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolygonScanConversionIterator.tar.gz
Type: application/x-tgz
Size: 10177 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20050615/cbc59c29/PolygonScanConversionIterator.tar-0001.bin


More information about the Insight-users mailing list