Difference between revisions of "Tracker Daemon"

From NAMIC Wiki
Jump to: navigation, search
Line 61: Line 61:
 
assumption that if the Tracker is running in a different computer,
 
assumption that if the Tracker is running in a different computer,
 
then the two computers have been time-synchronized.
 
then the two computers have been time-synchronized.
 +
 +
= Screenshots =

Revision as of 22:14, 20 December 2007

Home < Tracker Daemon

Purpose

Tracker Daemon is created for the communication between Slicer 3 and IGSTK through socket connection. For now, a program built on top of IGSTK can send tracking data to Slicer 3, which then updates the locator and related images accordingly. In the future, Tracker Daemon will be used to receive realtime images.

Recipe for using Tracker Daemon

  • Rerun CMake in the VTK that you used for building IGSTK and turn "VTK_USE_PARALLEL" ON. Then compile VTK (no need to make a clean build, it will just build the vtkParallel library).
  • Put the igstkTracker.cxx file from the NAMIC sandbox directory NAMICSandBox/trunk/IGSTK-Slicer-IntegrationViaSockets/IGSTKAdaptor into the IGSTK/Source directory. (replacing the existing one). Rerun CMake on IGSTK, then build IGSTK.
  • Configure the directory NAMICSandBox/trunk/IGSTK-Slicer-IntegrationViaSockets with CMake, provide in IGSTK_DIR the directory where you build IGSTK, and provide ITK_DIR and VTK_DIR as the directories that you used for building IGSTK. They don't have to be the same that you used for building Slicer.
  • Once you build from step (3) above, you will get three executables: igstkTrackerToolSocketRelayTest1.exe, igstkTrackerToolSocketRelayTest2.exe and igstkTransformSocketListener.exe. First, test your system by running the following commands: a) igstkTransformSocketListener.exe 16666 &; b) igstkTrackerToolSocketRelayTest2.exe localhost 16666 &. Preferably, run each command on a different console. That should print out the following output on the console (a):

$ Port = 16666
0 : 1 0 0 0 1 0 0 0 1 0 100 0
1 : 1 0 0 0 1 0 0 0 1 0.999983 99.995 0
2 : 1 0 0 0 1 0 0 0 1 1.99987 99.98 0
3 : 1 0 0 0 1 0 0 0 1 2.99955 99.955 0
4 : 1 0 0 0 1 0 0 0 1 3.99893 99.92 0
5 : 1 0 0 0 1 0 0 0 1 4.99792 99.875 0
6 : 1 0 0 0 1 0 0 0 1 5.9964 99.8201 0
7 : 1 0 0 0 1 0 0 0 1 6.99428 99.7551 0

This is a made-up tracker that provides position in a circle. If this works fine, then move to the following test:

  • Kill the two commands above.
  • Run, in separate consoles the following commands:

a) igstkTransformSocketListener.exe 16666 &
b) igstkTrackerToolSocketRelayTest1.exe localhost 16666 &

Note that now in (b) you use the executable with "1". This execuatble will initialize the Aurora Tracker in serial port 0, and start grabbing transforms and sending them through the socket. In console (a), you should see transform values comming in, but this time, the values will match the movements of the Aurora Tracker Tool.

  • If this works fine, then move to the real final test;
  • Kill the two commands above
  • Start Slicer IGT, and follows Steve recipe:

a) create a transform called "tracker"
b) load a dataset or a moder and make it a child of the "tracker" transform that you just created
c) Open the Interactor window and from there start the tracker daemon (I'll need help from Steve here, to remember the exact command).

  • Once Slicer is ready waiting for transforms, then do in a console the following command:

igstkTrackerToolSocketRelayTest1.exe localhost 8529 &
Note that this time we use a different port number. At that point, the Aurora tracker should be initialized (beeping), and Slicer should popup a message asking for authorization to let somebody connect in "127.0.0.1". If you click on "OK" in that message, then Slicer should start receiving the transforms from the socket, and you should see the volume moving as you move the Tracket tool.

Discussion

Luis: We were discussing yesterday the socket API with Andinet and Matt, and they pointed out that we should include the TimeStamp in the stream that is sent through the socket.

Slicer can decide later how to use this TimeStamp values.

Currently, this Time Stamp comes down to two doubles that mark the beginning and the end of the time window in which the Transform is known to be valid.

The values are in milliseconds, and are provided by the itk::RealTimeClock, which can actually be mapped back to a {hour, day, month, year} set of values if necessary.

That will make possible to synchronize with video inputs and with Transforms sent from other trackers. All of this under the assumption that if the Tracker is running in a different computer, then the two computers have been time-synchronized.

Screenshots