[vtkusers] vtkImagePlaneWidget crashes after a second load of data

Flo snrf at no-log.org
Fri Jul 27 11:41:46 EDT 2007

Hi Dean,

Thanks for the work around, it works perfectly well.

I'd like to change this behavior from vtkImagePlaneWidget. Can you  
throw me some idea on where/what to change ?
I'll implement them and then share the code as soon as it will be  
operational (as to my understanding it will thus be easier in the  
future to integrate this wonderful widget in other programs).

Thanks again.

On 27-Jul-07, at 9:07 AM, Dean Inglis wrote:

> Hi Flo,
> vtkImagePlaneWidget does not use reference counting
> when you set the input image data: it maintains a
> pointer to the input, so that if what the pointer
> points to changes (in terms of memory) you can get
> an access violation or a crash.  What you can do
> to work around this is to turn off the widget BEFORE
> you load your data, set it's input to NULL, then
> load your new data and turn the widget back on.
> Dean
> Dear all:
> after few hours of work I found that the problem is related to my
> RenderWindowInteractor affected to the vtkImagePlaneWidget . In fact,
> if I create two different windows with two separate
> RenderWindowInteractor and if I change the RenderWindowInteractor
> while loading the second data set, everything is fine.
> However, I still don't know what is wrong as, while reloading, I
> clean ever actors and volume in the renderwindow ---
> I'm wondering is there is not a leak/undeleted reference to the iren
> in the vtkImagePlaneWidget code .... Any help is appreciated !
> Flo.
> On 25-Jul-07, at 10:39 PM, Flo wrote:
>> Dear all:
>> I use vtkImagePlaneWidget in my application with the original code.
>> Using it while loading a dataset is fine.
>> However, while, in the same application sequence, I re-load a
>> second set of data, as soon as I click or interact with any of the
>> plane I have a crash. However, interacting with the renderer
>> (outside the ImagePlane outline but inside the renderwindow,
>> meaning zooming and rotation) is fine.
>> Any idea where this kind of crash my come from ?
>> regards,
>> Flo.
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

More information about the vtkusers mailing list