[vtkusers] Integer overflow in vtkImageAccumulate

Bill Lorensen bill.lorensen at gmail.com
Tue Oct 7 08:44:10 EDT 2014

Gib and David,

I am working on a gerrit patch to address Gib's problem. I add you
guys to the reviewer list once I complete it.


On Tue, Oct 7, 2014 at 8:23 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Gib,
> For VTK 5.10 and later, I added a new class called vtkImageHistogram
> that uses vtkIdType for the histogram, and another class called
> vtkImageHistogramStatistics that can automatically compute
> window/level.  These new classes should work fine on large images.
> Perhaps vtkImageAccumulate should also use vtkIdType (or should
> have a selectable output type.)
>  - David
> On Tue, Oct 7, 2014 at 1:30 AM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:
>> 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.
>> Cheers
>> Gib
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

Unpaid intern in BillsBasement at noware dot com

More information about the vtkusers mailing list