[Insight-developers] failing itkMathRoundProfileTest1: time to adjust helper function for portable rounding?

Tom Vercauteren tom.vercauteren at m4x.org
Tue Jun 2 04:02:31 EDT 2009


Hi Michel,

This test indeed needs to be updated.

Attached is a proposed patch that includes only the fix for
itkMathRoundProfileTest1 that was in a more inclusive previous patch:
http://www.itk.org/mailman/private/insight-developers/2009-May/012713.html

Regards,
Tom

On Mon, Jun 1, 2009 at 23:32, Michel Audette <michel.audette at kitware.com> wrote:
> Dear members of the community,
>
> I'm hammering away at portable-round and pixel-centering related failing
> tests
> http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=345664 , and one
> of the laggards is the itkMathRoundProfileTest1.
>
> If I understand the portable round fix correctly, it rounds to the next
> highest integer irrespective of whether or not the input number is positive
> or negative, so that the following in  itkMathRoundProfileTest1 is now
> inappropriate:
>
> double itkMathRoundTestHelperFunction( double x )
> {
>   if( x >= 0.0 )
>     {
>     return static_cast< int >( x + 0.5f );
>     }
>
>  return static_cast< int >( x - 0.5f );
> }
>
> Is that correct?
>
> Cheers,
>
> Michel
>
> --
> Michel Audette, Ph.D.
> R & D Engineer,
> Kitware Inc.,
> Chapel Hill, N.C.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk-MathRoundProfileTest1-2009-06-02.patch
Type: text/x-diff
Size: 7250 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090602/a543927d/attachment.patch>


More information about the Insight-developers mailing list