[IGSTK-Users] Threaded IGSTK views with Qt

Alo Mihkelson alo_m1 at yahoo.com
Tue Jan 17 06:04:05 EST 2012


Thanks for the reply,

On our initial attempts using QThread (Qt's threading system) we ran into problems with the OpenGL context switching between threads 
(wglMakeCurrent errors).

And based on some quick research, the underlying VTK library is not thread-safe so it seems like there would be some additional complexity involved from dealing with locking/mutexes when accessing the renderer from multiple threads.

I'm wondering if I'm on the right path here and if anyone has run into similar problems related to rendering and even general GUI responsiveness and how you've solved them in your IGS applications.

Cheers, Alo



________________________________
 From: "Cheng, Patrick" <PCheng at childrensnational.org>
To: Alo Mihkelson <alo_m1 at yahoo.com>; igstk-users at public.kitware.com 
Sent: Thursday, January 12, 2012 6:58 PM
Subject: RE: [IGSTK-Users] Threaded IGSTK views with Qt
 

Hi Alo,
 
You could consider doing it the other way around: spin off your resource intensive computation into a separate thread.
 
Take a look at igstkTracker class where we use ITK thread to create a separate thread to interact with the physical tracker.
 
itk::MultiThreader::Pointer     m_Threader;
m_Threader = itk::MultiThreader::New();
 
m_ThreadID = m_Threader->SpawnThread( TrackingThreadFunction, this );
 
ITK_THREAD_RETURN_TYPE Tracker::TrackingThreadFunction(void* pInfoStruct)
  { 
  ….
  }
 
Hope this helps,
 
Patrick
 
From:igstk-users-bounces at public.kitware.com [mailto:igstk-users-bounces at public.kitware.com] On Behalf Of Alo Mihkelson
Sent: Thursday, January 12, 2012 5:28 AM
To: igstk-users at public.kitware.com
Subject: [IGSTK-Users] Threaded IGSTK views with Qt
 
We're using IGSTK with Qt and would like to move the view rendering to a separate thread to avoid GUI slowdowns while rendering resource intensive (low-FPS) scenes. Is there a way to move the views/rendering out of the main Qt thread?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20120117/be2e1b9a/attachment.html>


More information about the IGSTK-Users mailing list