[vtk-developers] vtkImageReslice performance questions/improvemnts

David Gobbi david.gobbi at gmail.com
Tue Sep 21 19:47:12 EDT 2010


On Tue, Sep 21, 2010 at 5:32 PM, Sean McBride <sean at rogue-research.com> wrote:

> 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?

That #if was originally for Itanium, but should work on most (maybe
all?) 64-bit platforms, as long as they can efficiently convert double
to 64-bit int.  In other words, looks good to me!

But maybe I should push it... it also needs to use "vtkTypeInt64"
instead of "long long" or some compilers will choke.

  David



More information about the vtk-developers mailing list