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

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 15 13:12:17 EDT 2009


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
>
> 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/20090815/eb774b72/attachment.htm>


More information about the Insight-developers mailing list