[Insight-developers] vnl updates : Rounding Test : Performance and Correctness

Luis Ibanez luis.ibanez at kitware.com
Wed Dec 31 12:15:05 EST 2008


Amitha, Hans,

I actually agree with all your comments.

It seems that we all agree that a set of "Round" definitions is what we
need,
even though we anticipate that the most used will be the RoundItQuickly().

The challenge now is to identify a way of implementing this in a manner that
make
sense for both ITK developers, developers of ITK-based applications, and end
users.

Trying to look at it from Tom's perspective, the issue that I see is the the
decision of
speed vs multi-platform consistency will appear at the end-user level and
not at the
moment when an ITK developer is deciding which on of the available
implementations
of "round" to use.

In other words, the decision of "I just need this program to run as fast as
possible
and I don't care if the result is different in another platform" will most
likely be
made by an end-user (application user) than by an application developer, and

much less by an ITK developer.

This leads to suggest that the selection of the particular Round
implementation
should probably be managed by a CMake option that would be turned on at the
moment of configuring/building ITK and the said application.  By default,
probably we would use the settings for rounding in a consistent manner
across
platforms.

My suggestion would be to add a file

                                        itkMath.h

to Insight/Code/Common

 and to put in there the implementations of Round, Ceil, Floor.

Then add a CMake flag option to the top CMakeLists.txt file, to select
among the different implementations of round.

It could be:

CMake variable name:    ITK_ROUND_OPTION

CMake variable acceptable values:

                   MultiPlatform
                   Fast
                   Unbiased

The "Fast" option could delegate the rounding to the VNL implementation
(if that happens to be the most efficient one).

An alternative proposal would be to define Round as a Macro, and to
put it in itkMacro.h



       Luis


------------------------------------------------------------------------------
On Wed, Dec 31, 2008 at 11:32 AM, Hans Johnson <hans-johnson at uiowa.edu>wrote:

> Amitha:  Thanks.  Indeed the JustRoundItQuickly is likely the most intended
> use of round.   Perhaps what is needed are just two round functions
> (JustRoundItQuickly, RoundConsistentlyAcrossPlatforms).
>
> Hans
>
>
>
>
> On 12/31/08 10:23 AM, "Amitha Perera" <amitha.perera at kitware.com> wrote:
>
> > JustRoundItQuickly
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20081231/0db29c47/attachment.htm>


More information about the Insight-developers mailing list