[vtk-developers] vtkImageReslice performance questions/improvemnts

Sean McBride sean at rogue-research.com
Tue Sep 21 19:32:03 EDT 2010


On Tue, 14 Sep 2010 09:08:01 -0600, David Gobbi said:

>The general implementation "static_cast<int>(floor())" is the simplest
>correct implementation, even if it is inefficient, so I'd like to
>leave it as the general case.  But we could easily add an #ifdef to
>add whichever float-to-int conversion is most efficient for your
>platform.

David,

Regarding vtkResliceRound()... one of the conditional implementations is:

#elif defined ia64 || defined __ia64__ || defined IA64
  x += 103079215104.5;
  long long i = static_cast<long long>(x);
  return static_cast<int>(i - 103079215104LL);

On Mac OS X with the x86_64 arch (the default these days) none of those
is #defined.  

I've been running with "|| defined __x86_64__" added for several days
now and all seems well.  But I don't understand this code.  :)

Any reason I should not push this change?

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list