[Insight-developers] Appropriateness of filter data types

Joshua Cates cates@cayenne.cs.utah.edu
Wed, 4 Apr 2001 12:22:58 -0600 (MDT)


Hello,

Doing manual instantiations with CABLE has underscored the fact that not
all data types are really appropriate for our filters.  The stuff we are
doing here at Utah assumes the precision of floats or doubles.  Supporting
other data types directly is of dubious value and will potentially
confuse the user.

With this in mind, we are experimenting with restructuring our code so
that the algorithms require floats or doubles.  If instantiated with other
data types, the filter will automatically perform a copy to convert to an
image of floats or doubles and a copy to convert back once filtering is
complete.

This solves several problems:

1) Instantiations of the algorithms are more mathematically robust.
Isolates round-off errors to the copy operation.

2) Better documentation of the algorithm: its intended use, its
limitations, its requirements.

3) Eliminates confusion for an algorithm writer.  No worries about casting
for math function calls or assigments.

4) Eliminates multiple "warning: assignment to `short unsigned int' from
`float'" type messages on manual instantiations with inappropriate data
types during DLL builds

Of course this will be well documented for the user so they can weigh the
costs of instantiations with various data types against their particular
needs.

Don't yet know the mechanism of this conversion.  Ideally, we would use
partial template specialization to implement filters for float and double
types and then introduce copying for the default case.  VC++, of course,
does not allow us to do this.  So we may have to fall back on a less
optimal RTTI mechanism.  Any suggestions?  If others have a need for this
capability, we could work out a common methodology.

Josh.


______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@cs.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates