[Insight-developers] possible tcon topics

Will Schroeder will.schroeder at kitware.com
Fri Oct 27 08:30:04 EDT 2000


Please let me jump on a soapbox for a moment.

The solution that Lydia proposed has been looked at to some extent. As Lydia mentioned it is messy and ugly. There
is a general feeling here that this code is already extremely complex (some believe that is too complex
for many people to use, which will seriously impact its acceptance). We have to think hard about this.

Jim's proposal has some benefits that were not mentioned. By collecting in a single filter different 
specializations of the same basic algorithm, we avoid class explosion. That is, rather than a series
of filters Shrink2D, Shrink3D, Shrink4D, ShrinkND,....we have a single filter Shrink that does all
of these in the same class. This turns out to be important from the user's point of view...one of the
biggest criticisms of an (unnamed commercial) visualization system is that each variation was 
implemented in a separate "class." User's had a tough time figuring out the right filter to use. More
importantly, a pipeline that consists of a series of filters specialized (for example) to 2D, could not be
used for 3D data. So if you have a situation where you are reading data, of unknown dimension, or the
data dimension varies depending on the application input, you have to create several different
pipelines to handle the different situations. This is a real mess and forces the application developer to put
in all the machinery to handle the run-time variations.

Comments?

Will

At 10:29 PM 10/26/00 -0700, Lydia Ng wrote:
>FYI, I found a couple of articles showing how to do psuedo partial
>specialization
>in VC++6.0
>http://msdn.microsoft.com/peerjournal/vc/g062600b.asp
>http://www.oonumerics.org/oon/oon-list/archive/0528.html
>
>They seem equivalent and basically involves using nested classes - not very
>pretty though. Might be interesting as a starting point.
>
>Lydia

and from Jim Miller:

>The solution (currently) is to not use template specialization but rather put a "switch" or "if"
>statement in your GenerateData() method that calls the appropriate "specialized" routine. While this
>is a run-time specialization, it is called once per execution of the filter. I suspect the compiler
>will optimize out the "other" cases if the switches are all based on template parameters and
>typedefs.
>
>
>This switch could either switch on dimension, or even switch on pixel type using the "typeid"
>function.  For the later, I think the syntax is something like
>
>
>if (typeid(typename TPixel::ValueType) == typeid(unsigned short))
>...





More information about the Insight-developers mailing list