[Insight-developers] Questions about writing Polygon list to mask filter to Mask filter

kent williams norman-k-williams at uiowa.edu
Mon Aug 17 10:21:00 EDT 2009


Thanks for your reply. I will look at my options as regards input data
structures.  I think it should have, to use a literary term, parallel
construction with respect to itk::PolylineMask2DImageFilter.  I wasn¹t
previously aware of the ITK-specific container classes, which are of course
the logical way to go.

As for enforcing constraints, it¹s not hard to do. The code I have is
tailored to the input I¹m already generating ‹ for each *logical* slice in
an image (i.e. not necessarily the slices parallel to the acquisition
plane), a set of zero or more polygons in the plane of that slice.

If this sort of input is unique to just the program I¹m writing there¹s not
much point in turning it into a general purpose filter.  ITK does seem to
have a few filters so specific to a particular problem domain that they
probably get very little use. I¹d be interested in what other people think
about whether it¹s worth doing at all.

As for licensing, I actually got ahold of the original author of the book
where the code I adapted first appeared, and he said that he encouraged its
adaptation where ever it¹s useful.  He says he signed a contract with Dr.
Dobbs Journal to have them make the book available on line as PDF files, and
I¹ve contacted the editors there.  It¹s an implementation of an algorithm
described in the first Graphics Gems book (and I believe Foley and Van Damm
before that), so there should be no patent encumbrance.

At any rate I am doing due diligence on the licensing question.   Is it
sufficient to proceed on e-mails from the copyright holders that say ³sure,
knock yourself out,² or does the consortium want more formal documentation
of provenance?


On 8/15/09 12:12 PM, "Luis Ibanez" <luis.ibanez at kitware.com> wrote:

> 
> Hi Kent,
> 
> 1) It is not safe to assume that because something is posted online,
>     then a license is grated for using it. Take for example, the case of
>     the IEEE closed-access Journals, which entice authors to post the
>     papers online, (copyrighted by IEEE) but do not provide any explicit
>     license for anybody to download (copy) the papers.  Every person
>     who downloads an IEEE copyrighted paper from the web page on
>     an author is in fact committing copyright infringement.
> 
>     With this practice, obsolete publishers like IEEE attempt to disguise
>     the deficiencies of the copyright system for satisfying the needs of
>     scholarly publishing. In short, by allowing (and enticing) people to
>     commit petty copyright crimes, they delay the inevitable evolution
>     towards Open Access publications.
> 
>     You can only trust documents that provide a explicit license for use.
>     For example, the Public Library of Science (PLoS) Journals, and the
>     Creative Commons Attribution and Share-Alike license.
> 
> 
> 2) Assuming that because the code doesn't have a license, then it is
>     free for use, is also a dangerous leap.
> 
>     You may want stay away from any software whose license is not explicit.
>     Otherwise you are in for an unpleasant surprise, once you have become
>     dependent of that code.
> 
> 
> 3) Regarding the ITK-fication of the filter.
> 
>      When you need a list of object T as input to a filter you can pass them
>      as a container. Typicall a VectorContainer<T> or a MapContainer<T>.
>     
>     As you already pointed out, another option is to provide AddPolygon()
>     methods and to use an STL container internally. (ITK classes should
>     not use STL classes in their API, unfortunately we have several classes
>     that do so...).
>     
>     The decision between a container and a set of Add() methods will probably
>     be driven by whether you are going to pass 1~10 elements or 100~10000
>     elements. The Add methods are convenient for 1~10 elements. The container
>     classes will be convenient for hundreds or thousands of elements.
> 
> 
> 4) The limitation about the direction of the polygons:
> 
>      You want to document it and to enforce it     :-/
> 
>     Many developers don't read the documentation until after they
>      get an exception from the class....
> 
> 
> 
> 
>     My 2 cents,
> 
>  
>         Luis
> 
> 
> -------------------------------------------
> On Tue, Aug 11, 2009 at 1:14 PM, kent williams <norman-k-williams at uiowa.edu>
> wrote:
>> I implemented (in an ad hoc, non-ITK manner) using a scan-line algorithm to
>> generate a binary image from a set of planar polygons.  I based the code on
>> Michael Abrash's code from his book "Graphics Programming Black Book", as
>> suggested by Dan Mueller.
>> 
>> I don't think there's any licensing issues with this code (the book is
>> on-line as a PDF file, and the source code has no licensing information),
>> but I will try and contact Mr. Abrash and ask him about it.
>> 
>> So I now know how to use the algorithm in a filter, and it is many times
>> faster than testing each point to see if it is within a polygon.  But I have
>> some questions about 'ITK-izing' it.
>> 
>> 1. The existing polyline filters (itk::PolylineMask2DImageFilter,
>> itk::PolylineMaskImageFilter) are templated over the PolyLine type. The
>> tests for those filters use ParametricPaths.
>> 
>> What my code works on is a set of polygons, that are all congruent with a
>> slice in the 3D image.  So what class would be appropriate for input?  Is
>> there even a standard ITK way to have arbitary-length lists of input
>> objects?
>> 
>> Would it be better to have an 'AddPolygon' or 'AddPolyLine' method and add
>> instances of the Polyline type?
>> 
>> 2. The polygons in my current code are all constrained to be embedded in an
>> image slice, though not necessarily the plane of the two fastest moving
>> indices -- I handle the index permutation. Do I just document this
>> limitation, or try and enforce it?
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com <http://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
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090817/4c3e04cc/attachment.htm>


More information about the Insight-developers mailing list