[vtkusers] Integer overflow in vtkImageAccumulate

Gib Bogle g.bogle at auckland.ac.nz
Tue Oct 7 03:30:38 EDT 2014

Hi all,

I encountered a problem in 3DSlicer with the auto calculation of window/level.  This may be a well-known issue.  For some big 3D tiffs, the algorithm gives bad w/l values, i.e. < 0.  I have tracked this to vtkImageAccumulate() in vtkImageAccumulate.cxx, where the histogram is computed.  The problem is that the voxel counts are stored in an int array (outPtr), and it's possible to have more than 2^31 voxels with the same value (e.g. 0).  I admit that these are unusual tiffs - they are binary and big - so it's a rather extreme case, but it seems that this is going to bite others as image sizes increase.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141007/6776cc60/attachment.html>

More information about the vtkusers mailing list