[Insight-users] THE CONCEPT CHECKING REVOLUTION : Please review your filters

Luis Ibanez luis.ibanez at kitware.com
Thu Feb 16 20:40:42 EST 2006




1. THE PROBLEM

Given that ITK was designed and implemented using
Generic Programming, most of the classes are templated
over totally generic types.  However, some classes have
expectations about the capabilities of those types, and
those expectations are not always made explicit in the
code or in the documentation.

For example, some image filters are intended to be used
with images whose pixel type is float or double.
Instantiating those filters with image of other pixel
type will result in compilation errors, or run time
errors.




2. THE SOLUTION

The requirements over the types can be made explicit by adding
the notion of Concept Checking. This is done by introducing a
number of macros and helper templates that verify early on
whether a type provides the capabilities that are expected by
the filter or not.


A set of "concepts" have been created in the file:

    Insight/Code/Common/
                    itkConceptChecking.h


They include features such as: requiring that a pixel
type provides a multiplication operator, or an assignment
operator. Other concept may be to require that the dimension
of the input image matches the dimension of the output image.


These concepts should be introduced on every filter in order
to make this mechanism effective.

Every filter may have many different concepts that ought
to be introduced in the code. It is therefore not trivial
to implement a decent coverage of concept checking. The
support of the developers community is fundamental for
managing successfully this monumental task.





3. THE ACTION PLAN

Amy Squillacote (at Kitware) has courageously accepted the
challenge of introducing the concepts into the ITK filters.

Since there is a long list of filters, and a long list of
concepts. This process requires the assistance of most of
the developers. In particular, for defining what filters
ought to have what concepts.



For this purpose, Amy has created a Wiki Table with the
list of existing concepts:

http://www.itk.org/Wiki/Proposals:Concept_Checking



as well as a table with the list of candidate filters:

http://www.itk.org/Wiki/ConceptChecking:List_of_Filters



The numbers in the columns of the second table correspond
to the concepts listed in the first table.  The purpose
of the second table is to indicate what concept checker
should be introduced on every filter.


We will need the help of all the developers in order to
fill up this table correctly.


Please review this table and identify the filters that you
are familiar with and help us fill in the list of concepts
that should be checked for that filter.


Please note that Wiki pages are not very good for managing
simultaneous edits by multiple authors. It is therefore
convenient to find a way of preventing multiple developers
from updating the table simultaneously.  Any suggestions
on how to do this are welcome.


All these changes are intended to be introduced after we
cut the release of ITK 2.6.


Please let us know if you have any questions or concerns.



     Thanks



         Luis







More information about the Insight-users mailing list