Hi Kostas, thank you for trying out MITK-IGT :-)
The IGTTutialalStep1.cpp is very basic. There could indeed be a racing condition. The Delay() command should in theory give the tracking thread time to read new data from the sensors. I would suggest that you try to use the QmitkIGTExample functionality. It uses a Qt timer to read the data from the tools. Best regards, Jochen > -----Ursprüngliche Nachricht----- > Von: Kostas Pachopoulos [mailto:[email protected]] > Gesendet: Dienstag, 28. April 2009 16:11 > An: [email protected] > Betreff: [mitk-users] mitkIGT and MedSAFE integration > > Hallo everybody, > i am trying to add support for the Ascension MedSAFE device > (http://www.ascension-tech.com/medical/medSAFE.php) to mitkIGT. > Although this should be straightforward, since the API of the MedSAFE > device is 90+ % the same with the MicroBird one, i face some problems. > These are probably related to the threading support. Please feel free > to correct or do any additions. > > > MitkIGT architecture/funcionality > ================================== > Jochen Neuhaus kindly informed me for the following, regarding the > architecture/funcionality of mitkIGT. > ** "Tracking" (reading data from the sensors) is done by a separate > thread > ** These data are afterwards passed to the "Tools" and handled by them > (1 tool <-> 1 sensor) > ** A "NavigationDataRecorder", running on the Main thread, reads the > navigation data and writes them to a stream. > ** The two threads do not interact with each other in any way. It > is up to the scheduler to > decide what will be run next; this will change in the future. > ** If there is a filter between the "tracking" and the "recording", it > is executed by another thread. > > > Additional header and source files > =================================== > Support for MedSAFE is based on the following file additions: > -mitkMedSAFETool.h/cpp (mitkMedSAFETool.h should be removed, since it > adds no more to > mitkInternalTrackingTool.h) > -mitkMedSAFETrackingDevice.h/cpp > > and creating an "IGTMedSAFETest" test project with: > -IGTMedSAFETest.cpp file > > > The following existing IGT file have been edited: > -mitkTrackingTypes.h: > enum TrackingDeviceType { > ... > AscensionMedSAFE, > ... } > -mitkInternalTrackingTool.h: > class InternalTrackingTool: public TrackingTool { > ... > friend class MedSAFETrackingDevice; > ... } > -mitkTrackingDeviceSource.cpp: > Connect() { > ... > if (m_TrackingDevice->GetType()==mitk::AscensionMedSAFE) > this->CreateOutputs(); > ... } > > note: this is necessary for the same reason NDIAurora requires it. > > > CMake Settings > ================================== > cmake settings have been made in MITKIGTHardware.cmake and in > CMakeLists.txt (Core/IGT) > > > > Issues > ================================== > The problem i face is the following: > ** if i run my sample program, which is exactly the same as > IGTTutorialStep1.cpp without the DisplacementFilter, i get an XML > output, which repeats the values of the starting position of the > sensor. That is case whether the sensors are in movement or not. > > ** if i place 2 breakpoints; one inside the > "mitk::MedSAFETrackingDevice::TrackTools()" loop and one inside the > "mitk::NavigationDataRecorder::Update()" function, the XML data DO > change and follow the sensor movement There is possibly a race > condition somwhere. I try work this out. > > Unfortunately using a Thread Profiler like the Intel one, is not much > of a help, since after instrumenting the program an exception is > thrown. > > > I include attachments with all the files mentioned above, except the > IGT files the changes in which i have already pointed out > (mitkTrackingTypes.h, mitkInternalTrackingTool.h, > mitkTrackingDeviceSource.cpp) > > > Any help appreciated. > > Thanks, > Kostas ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
