[vtkusers] vtkImageAppend Runtime Error

Siavash Khallaghi siavashk at ece.ubc.ca
Tue Sep 15 20:49:33 EDT 2015


Hello,

I am struggling with a problem with vtkImageAppend. Let me explain what I am
trying to do.

The vtkImageAppend sits inside of a vtkCallback class (inherited from
vtkCommand) used for custom panning of vtkImageData (2D). Its purpose is to
stitch the new region to the region that is currently being displayed in the
renderer.

As the user pans, the vtkImageAppend filter is continuously called. The
relevant portion of my code is similar to this:

vtkSmartPointer<vtkMutexLock> mutex = vtkSmartPointer<vtkMutexLock> ::New();

vtkSmartPointer<vtkImageAppend> horizontalAppend =
vtkSmartPointer<vtkImageAppend>::New();

horizontalAppend->AddInputData(overlapImage); //overlap image is currently
displayed in the renderer
horizontalAppend->AddInputData(horizontalImage); //horizontalImage is the
horizontal difference image that is being panned to
horizontalAppend->SetAppendAxis(0);
//mutex->Lock();
this->horizontalAppend->Update();
//mutex->Unlock();

Sometimes, my code throws the following runtime error and crashes when I try
to pan:
Unhandled exception at 0x00007FF84C30320C (vtkFiltersCore-6.2.dll) in
Viewer.exe: 0xC0000005: Access violation reading location
0x000000C443D57000.

This feels like a thread safety issue to me, although I am not sure. I found
the following ticket that isrelated to vtkImageAppend in the Mantis bug
tracker. I am not sure if my problem is related to it:

http://www.vtk.org/Bug/view.php?id=12655

I also tried placing the update call inside mutex locks to make it thread
safe. But this did not help.

Why do you think the memory access error is happening? I would appreciate
any hints.

Thank you,

Siavash Khallaghi



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageAppend-Runtime-Error-tp5733951.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list