Difference between revisions of "OpenIGTLink"

From NAMIC Wiki
Jump to: navigation, search
Line 19: Line 19:
  
 
=Protocol=
 
=Protocol=
 
+
[[OpenIGTLink/Protocol | Open IGT Link Protocol]]  
===Header Structure===
 
  Bytes
 
  0  2                      14                                      34            42              50              58
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....
 
  | V |          TYPE        |              DEVICE_NAME              |  TIME_STAMP  |  BODY_SIZE  |    CRC64    |  BODY   
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....
 
 
 
===Byte Order===
 
Big endian should be used for all [http://www.opengroup.org/onlinepubs/007908799/xns/htonl.html numerical values] (version, body size, crc). Unused spaces are padded with 0 (binary).
 
 
 
===Header Fields===
 
{| border="1" cellpadding="5" cellspacing="0" align="center"
 
|-
 
| align="left style="background:#e0e0e0;" | Data
 
| align="left style="background:#e0e0e0;" | Type
 
| align="left style="background:#e0e0e0;" | Description
 
|-
 
| align="left" | V
 
| align="left" | Unsigned short (16bit)
 
| align="left" | Version number (1)
 
|-
 
| align="left" | TYPE
 
| align="left" | char[8]
 
| align="left" | Type name of data
 
|-
 
| align="left" | DEVICE_NAME
 
| align="left" | char[20]
 
| align="left" | Unique device name
 
|-
 
| align="left" | TIME_STAMP
 
| align="left" | 64 bit unsigned int
 
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused
 
|-
 
| align="left" | BODY_SIZE
 
| align="left" | 64 bit unsigned int
 
| align="left" | Size of body in bytes
 
|-
 
| align="left" | CRC
 
| align="left" | 64 bit unsigned int
 
| align="left" | 64 bit CRC for body data
 
|-
 
|}
 
 
 
= Data types =
 
 
 
==IMAGE==
 
Image data consists of ascii header information followed by binary image pixel data.
 
(Ascii header is used to maintain compatibility with SlicerDaemon connection)
 
 
 
space right-anterior-superior\n
 
dimensions <xsize> <ysize> <zsize>\n
 
space_origin (<x>, <y>, <z>)\n
 
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n
 
kinds space space space\n
 
components 1\n
 
scalar_type <scalar type #>\n
 
<binary image data>
 
 
 
Descriptions:
 
{| border="1" cellpadding="5" cellspacing="0" align="center"
 
|-
 
| align="left style="background:#e0e0e0;" | Data
 
| align="left style="background:#e0e0e0;" | Type
 
| align="left style="background:#e0e0e0;" | Description
 
|-
 
| align="left" | <xsize>, <ysize>, <zsize>
 
| align="left" | text number (real)
 
| align="left" | Center position of the image in RAS coordinate
 
|-
 
| align="left" | <tx>, <ty>, <tz>
 
| align="left" | text number (real)
 
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction
 
|-
 
| align="left" | <sx>, <sy>, <sz>
 
| align="left" | text number (real)
 
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction
 
|-
 
| align="left" | <nx>, <ny>, <nz>
 
| align="left" | text number (real)
 
| align="left" | Normal vector of image plane(direction for 'k' index) /  The length represents pixel size in 'z' direction or slice thickness
 
|-
 
| align="left" | <scalar type #>
 
| align="left" | Pixel scalar type number (Ascii)
 
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64
 
|-
 
| align="left" | <binary image data>
 
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)
 
| align="left" | Image data
 
|-
 
|}
 
 
 
==TRANSFORM==
 
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.
 
 
 
  Bytes (Body)
 
  58      62      66      70      74      78      82      86      90      94      98    102    106
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
  | (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) |
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 
 
==POSITION==
 
* 3D Position
 
* Optional: Orientation
 
 
 
==STATUS==
 
  Bytes (Body)
 
  58  60            68                          88
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
 
  | C |  Sub Code  |      Status name          |  Status message (optional)
 
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....
 
 
 
{| border="1" cellpadding="5" cellspacing="0"
 
|-
 
| align="left style="background:#e0e0e0;" | Data
 
| align="left style="background:#e0e0e0;" | Type
 
| align="left style="background:#e0e0e0;" | Description
 
|-
 
| align="left" | C
 
| align="left" | Unsigned short (16bit)
 
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)
 
|-
 
| align="left" | Sub Code
 
| align="left" | 64 bit integer
 
| align="left" | Sub code for the error (ex. 0x200 - file not found)
 
|-
 
| align="left" | Error name
 
| align="left" | char[20]
 
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this
 
|-
 
| align="left" | Status Message (optional)
 
| align="left" | char[ BodySize - 30 ]
 
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")
 
|-
 
|}
 
 
 
 
 
'''Status codes:'''<br />
 
0 No Errors Found (use status 1 instead!)<br />
 
1 OK (Default status)<br />
 
2 Unknown error<br />
 
3 Panic mode (emergency)<br />
 
4 Not found (file, configuration, device etc)<br />
 
5 Access denied<br />
 
6 Busy<br />
 
7 Time out / Connection lost<br />
 
8 Overflow / Can't be reached<br />
 
9 Checksum error<br />
 
10 Configuration error<br />
 
11 Not enough resource (memory, storage etc)<br />
 
12 Illegal/Unknown instruction (or feature not implemented)<br />
 
13 Device not ready (starting up)<br />
 
14 Manual mode (device does not accept commands)<br />
 
15 Device disabled<br />
 
16 Device not present<br />
 
17 Device version not known<br />
 
18 Hardware failure<br />
 
19 Exiting / shut down in progress<br />
 
<br />
 
 
 
= Open questions =
 
# What if the application receives hundreds of "position" packets? <br> Should we add "keep only the last" flag to the packet type?
 
# Authentication (other than Unique Name)
 
# Compression
 
# Priority
 
# Duplicate messages
 
#
 
  
 
= Resources =
 
= Resources =
 
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]
 
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]
* [[Slicer/Features/Middleware | Middleware features discussion]]
 
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]
 
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)
 

Revision as of 19:22, 10 January 2008

Home < OpenIGTLink

Open IGT Link is a simple network protocol intended for trackers, robots and other devices to send data to the main application. Some devices might accept commands.

(Please contact us if you would like to include other devices.)

License: new BSD license ©2008 Insight Software Consortium

People / Organizations

Protocol

Open IGT Link Protocol

Resources