[vtk-developers] Templated filters

Will Schroeder will.schroeder at kitware.com
Tue Feb 9 07:32:32 EST 2010


I think Luis thinks VTK uses random number generators and fuzzy math under
the hood. The last time I checked there were types used all over the place,
my goodness even templated types!!!! but maybe things have changed since I
last looked ;-)

The point is that there are design trade-offs. ITK exposes templates up the
wazoo in its header files, as a result direct wrapping has essentially
failed and therefore integration through interpreted languages like Python
is problematic (and a source of user complaints). Further evidence of the
impact of templating on wrapping comes from the NLM who will spend 100s of
thousands of $$$ to fix the situation i.e., to create a *typeless* layer.
And what is the typeless layer? well as several have suggested here one
solution is to use VTK!!! All of this mess is a direct outcome of ITK's
pervasive templating in the header files, and direct wrapping of these
header files.

On the other hand I agree that templated code is great for C++ programmers
when used judiciously (for example we don't want to use the 6 template
parameters on ITK mesh, which again probably should probably be considered a
failure due to excessive templating). Certainly there is room for more
templates in the headers of VTK and if we improve the wrapping it would free
us to use more if we so choose. However I think it is important to continue
to support other languages besides C++; some may prefer to use C++ but there
are compelling reasons to keep the Python, Java, etc. users happy. I think
to preserve the current gestalt of VTK, and to learn from the mistakes of
the ITK world, templates must be treated carefully, typically integrated
into a typeless layer, and when not, deployed in conjunction with a
clear usage policy and the appropriate machinery in the build system to
support the template instantiation / wrapping process.

Will

On Tue, Feb 9, 2010 at 3:22 AM, Biddiscombe, John A. <biddisco at cscs.ch>wrote:

> > As for templates, I disagree with Will. I think it makes the algorithm
> > code more readable and promotes generic programming. I wish VTK were
> > more like ITK...
> > I do like ITK's use of templating even though it inhibits wrapping. I
> > wish VTK could make more use of templates, but as we know, wrapping
> > inhibits this. I really don't miss writing tcl code. I prefer C++
> > these days for both VTK and ITK.
>
>
> I'd like to agree with Bill, and possibly Luis's long winded rant (though
> I'm not sure what he really wanted to say).
>
> Templates are wonderful and nice for many uses and it's a real shame that
> we allow wrapping issues to prevent us using them more.
>
> Wrapping really should be something 'extra' on top, that helps users do
> things and not the driving force behind the core toolkit.
>
> JB
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100209/b5ba8f0e/attachment.html>


More information about the vtk-developers mailing list