[vtkusers] vtkImageStencil problem

David Gobbi david.gobbi at gmail.com
Thu Aug 23 18:42:16 EDT 2012


Actually, looking through the git log for vtkImageStencilData, there were
a couple bugs fixed between VTK 5.8 and VTK 5.10.  Both are fixes
for things that could lead to bad pointers:

Date:   Tue Nov 15 10:16:47 2011 -0700
BUG: Fix incorrect code for combining adjacent extents.

Date:   Sun Oct 16 15:58:20 2011 -0600
BUG: Fix a valgrind UMC in vtkImageStencilData.

If you compiled your VTK from source, I suggest that you grab
a copy of VTK 5.10 and copy vtkImageStencilData.h/.cxx into
your copy of VTK 5.8.  (If you didn't compile from source, you
could just do a complete update from VTK 5.8 to VTK 5.10).

 - David


On Thu, Aug 23, 2012 at 4:33 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Lewes,
>
> If there is a bug, I suspect it would be in the Subtract() method, rather
> than in the vtkImageStencil filter.  I can look through the Subtract()
> code to see if there is anything that looks wrong.  Is there a way that
> you can create a minimal program+data that I can run on my own
> system to duplicate the crash?
>
>  - David
>
> On Thu, Aug 23, 2012 at 2:52 PM, liulewes <lewes_infor at hotmail.com> wrote:
>> Hi all, I'm using vtkImageStencil to create ROIs on an image. The
>> vtkImageStencilData::Add() works well for me, but
>> vtkImageStencilData::Subtract() will cause my program to crash form time to
>> time.
>> By looking at the source code, the program crashes in vtkImageStencil.cxx
>> line 194 where "tmpPtr" becomes invalid and (outSpanEndPtr - outPtr) becomes
>> negative. I'm not sure whether vtkImageStencilData::Subtract() causes this
>> problem or it's sth. else. Can anyone give some suggestions?
>> Lewes.



More information about the vtkusers mailing list