https://www.na-mic.org/w/api.php?action=feedcontributions&user=Csoma&feedformat=atomNAMIC Wiki - User contributions [en]2024-03-29T10:38:33ZUser contributionsMediaWiki 1.33.0https://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=27955OpenIGTLink/Protocol2008-07-03T19:56:40Z<p>Csoma: /* POSITION */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
<div class="redirectText">'''Open IGT Link protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types (Common across implementations) =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (12 or 21 or 24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of 3 or 4, 32 bit each (3x3 or 3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br /><br />
The W element of quaternion is also optional, defaults to 1.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
The uniform error reporting allows easy logging and can be the base of exception class in libraries.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "OK", "Warning" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=27628OpenIGTLink/Protocol2008-06-26T20:27:22Z<p>Csoma: /* STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
<div class="redirectText">'''Open IGT Link protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types (Common across implementations) =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
The uniform error reporting allows easy logging and can be the base of exception class in libraries.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "OK", "Warning" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=27627OpenIGTLink/Protocol2008-06-26T20:26:07Z<p>Csoma: /* STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
<div class="redirectText">'''Open IGT Link protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types (Common across implementations) =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
The uniform error reporting allows easy logging and can be the base of exception class in libraries.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=27512OpenIGTLink/Protocol/JHUBRP2008-06-25T14:49:02Z<p>Csoma: /* System Diagram */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
Source code:<br /> svn co http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTjhu<br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (12+16 = 28 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system) - 28 bytes<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=27471OpenIGTLink/Protocol/JHUBRP2008-06-24T21:26:53Z<p>Csoma: /* Query: GET_COORDINATE */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
Source code:<br /> svn co http://www.na-mic.org/svn/NAMICSandBox/trunk/OpenIGTjhu<br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (12+16 = 28 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system) - 28 bytes<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=27470OpenIGTLink/Protocol/JHUBRP2008-06-24T21:24:19Z<p>Csoma: /* Command: MOVE_TO */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
Source code:<br /> svn co http://www.na-mic.org/svn/NAMICSandBox/trunk/OpenIGTjhu<br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (12+16 = 28 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=26876OpenIGTLink/Protocol2008-06-14T18:41:47Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
<div class="redirectText">'''Open IGT Link protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types (Common across implementations) =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=26875OpenIGTLink/Protocol2008-06-14T18:40:40Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
<div class="redirectText">'''Open IGT Link protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=26874OpenIGTLink/Protocol2008-06-14T18:39:41Z<p>Csoma: /* Overview */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
= Protocol extensions =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
* [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar, 3: Vector)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Quaternion representation of position / orientation.<br />
<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one CAPABILITY packet for each implemented device<br />
<br />
<br />
==CAPABILITY==<br />
List of available TYPEs.<br />
<br />
Bytes (Body)<br />
58 70<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| TYPE (12bytes) | TYPE (12bytes) | | TYPE (12bytes) |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
* Back to [[OpenIGTLink]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUTRUS&diff=26873OpenIGTLink/Protocol/JHUTRUS2008-06-14T18:37:39Z<p>Csoma: New page: &lt;&lt; OpenIGTLink | Protocol <div class="redirectText">'''JHU TRUS Robot protocol description'''</div> <div class="floatright">__TOC__</di...</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU TRUS Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
TBA<br />
<br />
= Workflow =<br />
TBA<br />
<br />
= Open IGT Link Protocol =<br />
TBA<br />
<br />
= Mimimum command set =<br />
TBA</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=26872OpenIGTLink2008-06-14T18:36:06Z<p>Csoma: </p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. ([[OpenIGTLink/Protocol/JHUBRP | Robot IGT]] )<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Standard Open IGT Link Protocol description]] <br />
** [[OpenIGTLink/Protocol/JHUBRP | JHU MRI robot and encoders]]<br />
** [[OpenIGTLink/Protocol/JHUTRUS | JHU TRUS robot]]<br />
* [[OpenIGTLink/Slicer | Open IGT Link Interface for 3D Slicer]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
* [[OpenIGTLink/Discussion | Open discussions on Open IGT Link Protocol]]<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (Nagoya robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]<br />
* [http://lcsr.jhu.edu/OpenIGTLink A backup of this site]</div>Csomahttps://www.na-mic.org/w/index.php?title=2008_Summer_Project_Week&diff=260252008 Summer Project Week2008-05-27T19:17:01Z<p>Csoma: /* Attendee List */</p>
<hr />
<div>Back to [[Engineering:Programming_Events|Programming/Project Events]]<br />
<br />
[[Image:ProjectWeek-2008.png|thumb|220px|right|Summer 2008]]<br />
<br />
== Logistics ==<br />
<br />
'''Dates:''' June 23-27, 2008<br />
<br />
'''Location:''' MIT. [[Meeting_Locations:MIT_Grier_A_%26B|Grier Rooms A & B: 34-401A & 34-401B]].<br />
<br />
<br />
'''Registration Fee:''' $260 (this will cover the cost of breakfast, lunch and coffee breaks for the week). Due by Friday, June 13th, 2008. Please make checks out to "Massachusetts Institute of Technology" and mail to: Donna Kaufman, MIT, 77 Massachusetts Ave., 38-409a, Cambridge, MA 02139<br />
<br />
If you are attending for one day only, the registration fee is not required.<br />
<br />
'''Hotel:''' We have a group rate of $239/night (plus tax) for a room with either 1 king or 2 queen beds at the [http://www.hotelatmit.com Hotel at MIT (now called Le Meridien)]. [http://www.starwoodmeeting.com/StarGroupsWeb/booking/reservation?id=0805167317&key=4FD1B Please click here to reserve.]This rate is good only through June 1.<br />
<br />
Here is some information about several other Boston area hotels that are convenient to NA-MIC events: [[Boston_Hotels|Boston_Hotels]]. Summer is tourist season in Boston, so please book your rooms early.<br />
<br />
([[Project Week Logistics Checklist|This is a checklist for the onsite planning items]])<br />
<br />
==Introduction to NA-MIC Project Week==<br />
<br />
NA-MIC Project Week is a hands on activity -- programming using the [[NA-MIC-Kit|NA-MIC Kit]], algorithm design, and clinical application -- that has become one of the major events in the [[NA-MIC-Kit|NA-MIC Kit]] calendar. This event is the seventh of the [[Engineering:Programming_Events|'''series''']]. It is held in the summer at MIT (typically the last week of June), and a shorter version is held in Salt Lake City in the winter (typically the second week of January). <br />
The main goal of these events if to move forward the deliverables of NA-MIC. NA-MIC participants and their collaborators are welcome to attend. <br />
<br />
* NA-MIC Members: Participation in this event is voluntary -- if you don't think this will help you move forward in your work, there is no obligation to attend.<br />
* Ideal candidates are those who want to contribute to the [[NA-MIC-Kit|NA-MIC Kit]], and those who can help make it happen.<br />
* This is not an introduction to the components of the [[NA-MIC-Kit|NA-MIC Kit]].<br />
* NA-MIC Core 1 (Algorithms) - bring your algorithms and code to work on in the company of Core 2 engineers and Core 3 scientists.<br />
* NA-MIC Core 2 (Engineering) - bring your code for infrastructure and applications to extend the [[NA-MIC-Kit|NA-MIC Kit]] capabilities, integrate Core 1 algorithms, and refine workflows for Core 3.<br />
* NA-MIC Core 3 (DBP) - bring your data to work on with the [[NA-MIC-Kit|NA-MIC Kit]] and get assistance and provide feedback to Core 1 scientists and Core 2 engineers.<br />
* External Collaborators - if you are working on a project that uses the [[NA-MIC-Kit|NA-MIC kit]], and want to participate to get help from NA-MIC Engineering, please send an email to Tina Kapur (tkapur at bwh.harvard.edu). Please note that the event is open to people outside NA-MIC, subject to availability.<br />
* Everyone should '''bring a laptop'''. We will have four projectors.<br />
* About half the time will be spent working on projects and the other half in project related discussions.<br />
* You '''do''' need to be actively working on a NA-MIC related project in order to make this investment worthwhile for everyone.<br />
<br />
== Agenda==<br />
* Monday <br />
** noon-1pm lunch <br />
**1pm: Welcome (Ron Kikinis)<br />
** 1:05-3:30pm Introduce [[#Projects|Projects]] using templated wiki pages (all Project Leads) ([[NA-MIC/Projects/Theme/Template|Wiki Template]]) <br />
** 3:30-5:30pm Start project work<br />
* Tuesday <br />
** 8:30am breakfast<br />
** 9:00-9:45am: NA-MIC Software Process <br />
** 10-10:30am [[Project Week 2008 Slicer 3.0 Update|Slicer 3.0 Update]] (Jim Miller, Steve Pieper)<br />
** noon lunch<br />
** 2:30-3:30pm: [[Project Week 2008 Special topic breakout: Non-Linear Registration]] <br />
** 5:30pm adjourn for day<br />
* Wednesday <br />
** 8:30am breakfast<br />
** 9:00-12pm [[Project Week 2008 Special topic breakout: ITK]] (Luis Ibanez)<br />
** noon lunch<br />
** 2:30-3:30pm: [[Project Week 2008 Special topic breakout: XNAT Database]] (Daniel Marcus)<br />
** 5:30pm adjourn for day<br />
* Thursday<br />
** 8:30am breakfast<br />
** noon lunch<br />
**2:30-3:30pm [[Project Week 2008 Special topic breakout: GWE]] (Marco Ruiz)<br />
** 5:30pm adjourn for day<br />
* Friday <br />
** 8:30am breakfast<br />
** 10am-noon: Project Progress using update [[#Projects|Project Wiki pages]]<br />
** noon lunch boxes and adjourn. (Next one [[AHM_2009| in Utah the week of Jan 5, 2009]])<br />
<br />
== Preparation ==<br />
<br />
# Please make sure that you are on the http://public.kitware.com/cgi-bin/mailman/listinfo/na-mic-project-week mailing list<br />
<br />
# [[Engineering:TCON_2008|May 08 and May 15 TCON DBPs ONLY]] at 3pm ET to discuss NA-MIC DBP Projects ONLY. <br />
# [[Engineering:TCON_2008|May 22 TCON#1]] at 3pm ET to discuss NA-MIC Engr Core Projects and Assign/Verify Teams<br />
# [[Engineering:TCON_2008|May 29 TCON#2]] at 3pm ET to discuss NA-MIC ALGORITHMS Core Lead Projects. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 5 TCON#3]] at 3pm ET to discuss NA-MIC EXTERNAL Collaborations. All NIH funded "collaborations with NCBC" leads should call. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 12 TCON#4]] at 3pm ET to discuss NA-MIC EXTERNAL Collaborations. All other collaboration leads should call. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 19 TCON#5]] at 3pm ET to tie loose ends. Anyone with un-addressed questions should call.<br />
# By 3pm ET on June 12, 2008: [[NA-MIC/Projects/Theme/Template|Complete a templated wiki page for your project]]. Please do not edit the template page itself, but create a new page for your project and cut-and-paste the text from this template page. If you have questions, please send an email to tkapur at bwh.harvard.edu.<br />
# By 3pm on June 19, 2008: Create a directory for each project on the [[Engineering:SandBox|NAMIC Sandbox]] (Zack)<br />
## Commit on each sandbox directory the code examples/snippets that represent our first guesses of appropriate methods. (Luis and Steve will help with this, as needed)<br />
## Gather test images in any of the Data sharing resources we have (e.g. the BIRN). These ones don't have to be many. At least three different cases, so we can get an idea of the modality-specific characteristics of these images. Put the IDs of these data sets on the wiki page. (the participants must do this.)<br />
## Setup nightly tests on a separate Dashboard, where we will run the methods that we are experimenting with. The test should post result images and computation time. (Zack)<br />
# Please note that by the time we get to the project event, we should be trying to close off a project milestone rather than starting to work on one...<br />
<br />
== A History in Wiki Links ==<br />
<br />
A history of all the programming/project events in NA-MIC is available by following [[Engineering:Programming_Events|this link]].<br />
<br />
== Projects ==<br />
<br />
===DBP II===<br />
These are projects by the new set of DBPS:<br />
#[[DBP2:Harvard|Velocardio Facial Syndrome (VCFS) as a Genetic Model for Schizophrenia]] (Harvard: Marek Kubicki, PI)<br />
##EPI-DWI Distortion correction (Sylvain Bouix BWH, Tauseef Rehman GATech)<br />
##EPI-DWI Eddy Current distortion correction (Sylvain Bouix BWH, Ran Tao Utah)<br />
##Lobe Parcellation of 3T MR data - need help parametrization (Sylvain Bouix BWH, Priya Srinivasan BWH, Brad Davis Kitware)<br />
#[[DBP2:UNC|Longitudinal MRI Study of Early Brain Development in Autism]] (UNC: Heather Hazlett, Joseph Piven, PI)<br />
##Add Projects for this DBP here...<br />
#[[DBP2:MIND|Analysis of Brain Lesions in Lupus]] (MIND/UNM: Jeremy Bockholt, Charles Gasparovic PI)<br />
##[[DBP2:MIND:RoadmapProject|Finish Roadmap Project]]<br />
##[[DBP2:MIND:LongitudinalRegistrationProject|Longitudinal Registration]]<br />
##[[DBP2:MIND:BeyondLesionsProject|Beyond Lesions]]<br />
#[[DBP2:JHU|Segmentation and Registration Tools for Robotic Prostate Intervention]] (Queens/JHU: Gabor Fichtinger, PI)<br />
##Add Projects for this DBP here...<br />
<br />
===Structural Analysis===<br />
<br />
===Diffusion Image Analysis===<br />
<br />
===Calibration/Validation===<br />
<br />
===NA-MIC Kit - Slicer 3===<br />
<br />
===External Collaborations===<br />
#[[NA-MIC/Projects/Collaboration/UWA-Perth]] (Adam Wittek)<br />
#[[NA-MIC/Projects/Collaboration/MRSI Module for Slicer]] (Bjoern Menze)<br />
<br />
===Non-Medical Collaborations===<br />
<br />
==Attendee List==<br />
# Ron Kikinis, BWH<br />
# Gary Christensen, The University of Iowa<br />
# Jeffrey Hawley, Gary Christensen's student<br />
# Kate Raising, Gary Christensen's student<br />
# Nathan Fritze, Gary Christensen's student<br />
# Paul Song, Gary Christensen's student<br />
# Cheng Zhang, Gary Christensen's student<br />
# Ying Wei, Gary Christensen's student<br />
# Nathan Burnette, The University of Iowa<br />
# Hans Johnson, The University of Iowa<br />
# Vincent Magnotta, The University of Iowa<br />
# Steve Pieper, Isomics, Core 2/6<br />
# Dana C. Peters, BIDMC Harvard Medical<br />
# Jason Taclas, BIDMC Harvard Medical<br />
# Nicole Aucoin, BWH, Core 2<br />
# Will Schroeder, Kitware, Cores 2/4<br />
# Sebastien Barre, Kitware, Core 2<br />
# Julien Jomier, Kitware, Core 2<br />
# Luis Ibanez, Kitware, Core 2<br />
# Curtis Lisle, KnowledgeVis, Core 2<br />
# Katie Hayes, BWH, Core 2<br />
# Randy Gollub, MGH, Core 5<br />
# Clement Vachet, UNC, Core 3<br />
# Casey Goodlett, Utah, Core 1<br />
# Jeffrey Grethe, UCSD, Core 2<br />
# Marco Ruiz, UCSD, Core 2<br />
# Zhen Qian, Rutgers University<br />
# Jinghao Zhou, Rutgers University<br />
# Luca Antiga, Mario Negri Institute<br />
# Adam Wittek, The University of Western Australia<br />
# Grand Joldes, The University of Western Australia<br />
# Jamie Berger, The University of Western Australia<br />
# Serdar Balci, MIT, Core 1<br />
# Bryce Kim, MIT, Core1<br />
# Vincent Magnotta, The University of Iowa<br />
# Tina Kapur, BWH, Core 6<br />
# Carling Cheung, Robarts Research Institute / The University of Western Ontario<br />
# Danielle Pace, Robarts Research Institute / The University of Western Ontario<br />
# Sean Megason, Dept of Systems Biology, Harvard Medical School<br />
# Alex Gouaillard, Dept of Systems Biology, Harvard Medical School<br />
# Kishore Mosaliganti, Dept of Systems Biology, Harvard Medical School<br />
# Arnaud Gelas, Dept of Systems Biology, Harvard Medical School<br />
# Sonia Pujol, Surgical Planning Laboratory, BWH<br />
# Bjoern Menze, (then) Surgical Planning Laboratory, BWH<br />
# Alex Yarmarkovich, Isomics, Core 2<br />
# Sylvain Bouix, BWH, Core 3<br />
# Priya Srinivasan, BWH, Core 3<br />
# Chris Churas, UCSD, Core 2<br />
# John Melonakos, Georgia Tech, Core 1<br />
# Yi Gao, Georgia Tech, Core 1<br />
# Tauseef Rehman, Georgia Tech, Core 1<br />
# Clare Poynton, MIT, Core 1<br />
# H. Jeremy Bockholt, MRN Lupus DBP Core 3<br />
# Mark Scully, MRN Lupus DBP Core 3<br />
# Gabor Fichtinger, Queen's, Core 2<br />
# David Gobbi, Queen's, Core 2<br />
# Purang Abolmaesumi, Queen's, Core 2<br />
# Siddharth Vikal, Queen's, Core 2<br />
# Daniel Blezek, Mayo<br />
# Csaba Csoma, JHU, Core 2<br />
<br />
==Pictures==</div>Csomahttps://www.na-mic.org/w/index.php?title=2008_Summer_Project_Week&diff=260242008 Summer Project Week2008-05-27T19:16:45Z<p>Csoma: /* Attendee List */</p>
<hr />
<div>Back to [[Engineering:Programming_Events|Programming/Project Events]]<br />
<br />
[[Image:ProjectWeek-2008.png|thumb|220px|right|Summer 2008]]<br />
<br />
== Logistics ==<br />
<br />
'''Dates:''' June 23-27, 2008<br />
<br />
'''Location:''' MIT. [[Meeting_Locations:MIT_Grier_A_%26B|Grier Rooms A & B: 34-401A & 34-401B]].<br />
<br />
<br />
'''Registration Fee:''' $260 (this will cover the cost of breakfast, lunch and coffee breaks for the week). Due by Friday, June 13th, 2008. Please make checks out to "Massachusetts Institute of Technology" and mail to: Donna Kaufman, MIT, 77 Massachusetts Ave., 38-409a, Cambridge, MA 02139<br />
<br />
If you are attending for one day only, the registration fee is not required.<br />
<br />
'''Hotel:''' We have a group rate of $239/night (plus tax) for a room with either 1 king or 2 queen beds at the [http://www.hotelatmit.com Hotel at MIT (now called Le Meridien)]. [http://www.starwoodmeeting.com/StarGroupsWeb/booking/reservation?id=0805167317&key=4FD1B Please click here to reserve.]This rate is good only through June 1.<br />
<br />
Here is some information about several other Boston area hotels that are convenient to NA-MIC events: [[Boston_Hotels|Boston_Hotels]]. Summer is tourist season in Boston, so please book your rooms early.<br />
<br />
([[Project Week Logistics Checklist|This is a checklist for the onsite planning items]])<br />
<br />
==Introduction to NA-MIC Project Week==<br />
<br />
NA-MIC Project Week is a hands on activity -- programming using the [[NA-MIC-Kit|NA-MIC Kit]], algorithm design, and clinical application -- that has become one of the major events in the [[NA-MIC-Kit|NA-MIC Kit]] calendar. This event is the seventh of the [[Engineering:Programming_Events|'''series''']]. It is held in the summer at MIT (typically the last week of June), and a shorter version is held in Salt Lake City in the winter (typically the second week of January). <br />
The main goal of these events if to move forward the deliverables of NA-MIC. NA-MIC participants and their collaborators are welcome to attend. <br />
<br />
* NA-MIC Members: Participation in this event is voluntary -- if you don't think this will help you move forward in your work, there is no obligation to attend.<br />
* Ideal candidates are those who want to contribute to the [[NA-MIC-Kit|NA-MIC Kit]], and those who can help make it happen.<br />
* This is not an introduction to the components of the [[NA-MIC-Kit|NA-MIC Kit]].<br />
* NA-MIC Core 1 (Algorithms) - bring your algorithms and code to work on in the company of Core 2 engineers and Core 3 scientists.<br />
* NA-MIC Core 2 (Engineering) - bring your code for infrastructure and applications to extend the [[NA-MIC-Kit|NA-MIC Kit]] capabilities, integrate Core 1 algorithms, and refine workflows for Core 3.<br />
* NA-MIC Core 3 (DBP) - bring your data to work on with the [[NA-MIC-Kit|NA-MIC Kit]] and get assistance and provide feedback to Core 1 scientists and Core 2 engineers.<br />
* External Collaborators - if you are working on a project that uses the [[NA-MIC-Kit|NA-MIC kit]], and want to participate to get help from NA-MIC Engineering, please send an email to Tina Kapur (tkapur at bwh.harvard.edu). Please note that the event is open to people outside NA-MIC, subject to availability.<br />
* Everyone should '''bring a laptop'''. We will have four projectors.<br />
* About half the time will be spent working on projects and the other half in project related discussions.<br />
* You '''do''' need to be actively working on a NA-MIC related project in order to make this investment worthwhile for everyone.<br />
<br />
== Agenda==<br />
* Monday <br />
** noon-1pm lunch <br />
**1pm: Welcome (Ron Kikinis)<br />
** 1:05-3:30pm Introduce [[#Projects|Projects]] using templated wiki pages (all Project Leads) ([[NA-MIC/Projects/Theme/Template|Wiki Template]]) <br />
** 3:30-5:30pm Start project work<br />
* Tuesday <br />
** 8:30am breakfast<br />
** 9:00-9:45am: NA-MIC Software Process <br />
** 10-10:30am [[Project Week 2008 Slicer 3.0 Update|Slicer 3.0 Update]] (Jim Miller, Steve Pieper)<br />
** noon lunch<br />
** 2:30-3:30pm: [[Project Week 2008 Special topic breakout: Non-Linear Registration]] <br />
** 5:30pm adjourn for day<br />
* Wednesday <br />
** 8:30am breakfast<br />
** 9:00-12pm [[Project Week 2008 Special topic breakout: ITK]] (Luis Ibanez)<br />
** noon lunch<br />
** 2:30-3:30pm: [[Project Week 2008 Special topic breakout: XNAT Database]] (Daniel Marcus)<br />
** 5:30pm adjourn for day<br />
* Thursday<br />
** 8:30am breakfast<br />
** noon lunch<br />
**2:30-3:30pm [[Project Week 2008 Special topic breakout: GWE]] (Marco Ruiz)<br />
** 5:30pm adjourn for day<br />
* Friday <br />
** 8:30am breakfast<br />
** 10am-noon: Project Progress using update [[#Projects|Project Wiki pages]]<br />
** noon lunch boxes and adjourn. (Next one [[AHM_2009| in Utah the week of Jan 5, 2009]])<br />
<br />
== Preparation ==<br />
<br />
# Please make sure that you are on the http://public.kitware.com/cgi-bin/mailman/listinfo/na-mic-project-week mailing list<br />
<br />
# [[Engineering:TCON_2008|May 08 and May 15 TCON DBPs ONLY]] at 3pm ET to discuss NA-MIC DBP Projects ONLY. <br />
# [[Engineering:TCON_2008|May 22 TCON#1]] at 3pm ET to discuss NA-MIC Engr Core Projects and Assign/Verify Teams<br />
# [[Engineering:TCON_2008|May 29 TCON#2]] at 3pm ET to discuss NA-MIC ALGORITHMS Core Lead Projects. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 5 TCON#3]] at 3pm ET to discuss NA-MIC EXTERNAL Collaborations. All NIH funded "collaborations with NCBC" leads should call. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 12 TCON#4]] at 3pm ET to discuss NA-MIC EXTERNAL Collaborations. All other collaboration leads should call. Project leads should sign up for a slot [[Engineering:TCON_2008|here]]. Projects will be discussed in order of the signups. <br />
# [[Engineering:TCON_2008|June 19 TCON#5]] at 3pm ET to tie loose ends. Anyone with un-addressed questions should call.<br />
# By 3pm ET on June 12, 2008: [[NA-MIC/Projects/Theme/Template|Complete a templated wiki page for your project]]. Please do not edit the template page itself, but create a new page for your project and cut-and-paste the text from this template page. If you have questions, please send an email to tkapur at bwh.harvard.edu.<br />
# By 3pm on June 19, 2008: Create a directory for each project on the [[Engineering:SandBox|NAMIC Sandbox]] (Zack)<br />
## Commit on each sandbox directory the code examples/snippets that represent our first guesses of appropriate methods. (Luis and Steve will help with this, as needed)<br />
## Gather test images in any of the Data sharing resources we have (e.g. the BIRN). These ones don't have to be many. At least three different cases, so we can get an idea of the modality-specific characteristics of these images. Put the IDs of these data sets on the wiki page. (the participants must do this.)<br />
## Setup nightly tests on a separate Dashboard, where we will run the methods that we are experimenting with. The test should post result images and computation time. (Zack)<br />
# Please note that by the time we get to the project event, we should be trying to close off a project milestone rather than starting to work on one...<br />
<br />
== A History in Wiki Links ==<br />
<br />
A history of all the programming/project events in NA-MIC is available by following [[Engineering:Programming_Events|this link]].<br />
<br />
== Projects ==<br />
<br />
===DBP II===<br />
These are projects by the new set of DBPS:<br />
#[[DBP2:Harvard|Velocardio Facial Syndrome (VCFS) as a Genetic Model for Schizophrenia]] (Harvard: Marek Kubicki, PI)<br />
##EPI-DWI Distortion correction (Sylvain Bouix BWH, Tauseef Rehman GATech)<br />
##EPI-DWI Eddy Current distortion correction (Sylvain Bouix BWH, Ran Tao Utah)<br />
##Lobe Parcellation of 3T MR data - need help parametrization (Sylvain Bouix BWH, Priya Srinivasan BWH, Brad Davis Kitware)<br />
#[[DBP2:UNC|Longitudinal MRI Study of Early Brain Development in Autism]] (UNC: Heather Hazlett, Joseph Piven, PI)<br />
##Add Projects for this DBP here...<br />
#[[DBP2:MIND|Analysis of Brain Lesions in Lupus]] (MIND/UNM: Jeremy Bockholt, Charles Gasparovic PI)<br />
##[[DBP2:MIND:RoadmapProject|Finish Roadmap Project]]<br />
##[[DBP2:MIND:LongitudinalRegistrationProject|Longitudinal Registration]]<br />
##[[DBP2:MIND:BeyondLesionsProject|Beyond Lesions]]<br />
#[[DBP2:JHU|Segmentation and Registration Tools for Robotic Prostate Intervention]] (Queens/JHU: Gabor Fichtinger, PI)<br />
##Add Projects for this DBP here...<br />
<br />
===Structural Analysis===<br />
<br />
===Diffusion Image Analysis===<br />
<br />
===Calibration/Validation===<br />
<br />
===NA-MIC Kit - Slicer 3===<br />
<br />
===External Collaborations===<br />
#[[NA-MIC/Projects/Collaboration/UWA-Perth]] (Adam Wittek)<br />
#[[NA-MIC/Projects/Collaboration/MRSI Module for Slicer]] (Bjoern Menze)<br />
<br />
===Non-Medical Collaborations===<br />
<br />
==Attendee List==<br />
# Ron Kikinis, BWH<br />
# Gary Christensen, The University of Iowa<br />
# Jeffrey Hawley, Gary Christensen's student<br />
# Kate Raising, Gary Christensen's student<br />
# Nathan Fritze, Gary Christensen's student<br />
# Paul Song, Gary Christensen's student<br />
# Cheng Zhang, Gary Christensen's student<br />
# Ying Wei, Gary Christensen's student<br />
# Nathan Burnette, The University of Iowa<br />
# Hans Johnson, The University of Iowa<br />
# Vincent Magnotta, The University of Iowa<br />
# Steve Pieper, Isomics, Core 2/6<br />
# Dana C. Peters, BIDMC Harvard Medical<br />
# Jason Taclas, BIDMC Harvard Medical<br />
# Nicole Aucoin, BWH, Core 2<br />
# Will Schroeder, Kitware, Cores 2/4<br />
# Sebastien Barre, Kitware, Core 2<br />
# Julien Jomier, Kitware, Core 2<br />
# Luis Ibanez, Kitware, Core 2<br />
# Curtis Lisle, KnowledgeVis, Core 2<br />
# Katie Hayes, BWH, Core 2<br />
# Randy Gollub, MGH, Core 5<br />
# Clement Vachet, UNC, Core 3<br />
# Casey Goodlett, Utah, Core 1<br />
# Jeffrey Grethe, UCSD, Core 2<br />
# Marco Ruiz, UCSD, Core 2<br />
# Zhen Qian, Rutgers University<br />
# Jinghao Zhou, Rutgers University<br />
# Luca Antiga, Mario Negri Institute<br />
# Adam Wittek, The University of Western Australia<br />
# Grand Joldes, The University of Western Australia<br />
# Jamie Berger, The University of Western Australia<br />
# Serdar Balci, MIT, Core 1<br />
# Bryce Kim, MIT, Core1<br />
# Vincent Magnotta, The University of Iowa<br />
# Tina Kapur, BWH, Core 6<br />
# Carling Cheung, Robarts Research Institute / The University of Western Ontario<br />
# Danielle Pace, Robarts Research Institute / The University of Western Ontario<br />
# Sean Megason, Dept of Systems Biology, Harvard Medical School<br />
# Alex Gouaillard, Dept of Systems Biology, Harvard Medical School<br />
# Kishore Mosaliganti, Dept of Systems Biology, Harvard Medical School<br />
# Arnaud Gelas, Dept of Systems Biology, Harvard Medical School<br />
# Sonia Pujol, Surgical Planning Laboratory, BWH<br />
# Bjoern Menze, (then) Surgical Planning Laboratory, BWH<br />
# Alex Yarmarkovich, Isomics, Core 2<br />
# Sylvain Bouix, BWH, Core 3<br />
# Priya Srinivasan, BWH, Core 3<br />
# Chris Churas, UCSD, Core 2<br />
# John Melonakos, Georgia Tech, Core 1<br />
# Yi Gao, Georgia Tech, Core 1<br />
# Tauseef Rehman, Georgia Tech, Core 1<br />
# Clare Poynton, MIT, Core 1<br />
# H. Jeremy Bockholt, MRN Lupus DBP Core 3<br />
# Mark Scully, MRN Lupus DBP Core 3<br />
# Gabor Fichtinger, Queen's, Core 2<br />
# David Gobbi, Queen's, Core 2<br />
# Purang Abolmaesumi, Queen's, Core 2<br />
# Siddharth Vikal, Queen's, Core 2<br />
# Daniel Blezek, Mayo<br />
# Csaba Csoma, JHU<br />
<br />
==Pictures==</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=24913OpenIGTLink/Protocol/JHUBRP2008-05-19T16:14:00Z<p>Csoma: /* Open IGT Link Protocol */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
Source code:<br /> svn co http://www.na-mic.org/svn/NAMICSandBox/trunk/OpenIGTjhu<br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=24908OpenIGTLink/Protocol2008-05-19T16:10:25Z<p>Csoma: /* POSITION */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
<br />
==CAPABILITY==<br />
Response from the device with description of the implemented protocols and functions available.<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (0,0,0,1)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name) -- SSL<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=24907OpenIGTLink/Protocol2008-05-19T16:09:40Z<p>Csoma: /* POSITION */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
<br />
==CAPABILITY==<br />
Response from the device with description of the implemented protocols and functions available.<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of four 32 bit (3x4 byte) floats: orientation quaternion, normalized<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz | W |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name) -- SSL<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=24905OpenIGTLink/Protocol/JHUBRP2008-05-19T16:01:33Z<p>Csoma: /* System Diagram */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
Source code:<br /> svn co http://www.na-mic.org/svn/NAMICSandBox/trunk/OpenIGTjhu<br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Library&diff=24877OpenIGTLink/Library2008-05-19T14:41:19Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<div class="floatright">__TOC__</div><br />
<br />
= Source code =<br />
<br />
An Open Source implementation of the OpenIGTLink protocol is available at<br />
<br />
http://www.na-mic.org/svn/NAMICSandBox/trunk/OpenIGTLink/<br />
<br />
On Windows, [http://tortoisesvn.tigris.org/ TortoiseSVN] provides an easy-to-use, graphical interface to Subversion.<br />
<br />
= License =<br />
This code is distributed under the [http://www.opensource.org/licenses/bsd-license.php new BSD License].<br />
<br />
= Design =<br />
<br />
* [[OpenIGTLink/Library/Design | Design ]]<br />
* [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Meeting_5Feb08 Weekly Meeting: February 5th]<br />
<br />
= Building instructions =<br />
* [[OpenIGTLink/Library/Build | How to build the library?]]<br />
<br />
<br />
= Tutorial =</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=23855OpenIGTLink/Protocol2008-04-16T17:05:56Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
==GET_CAPABILITY==<br />
Query for device capabilities.<br />
<br />
<br />
==CAPABILITY==<br />
Response from the device with description of the implemented protocols and functions available.<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name) -- SSL<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=23576OpenIGTLink/Protocol2008-04-03T03:51:05Z<p>Csoma: /* Open questions */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name) -- SSL<br />
# Compression?<br />
# Duplicate messages<br />
# "GetCapability" message<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=23135OpenIGTLink2008-03-24T15:46:25Z<p>Csoma: /* People / Organizations */</p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. ([[OpenIGTLink/Protocol/JHUBRP | Robot IGT]] )<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Open IGT Link INterface for 3D Slicer]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (Nagoya robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]<br />
* [http://lcsr.jhu.edu/OpenIGTLink A backup of this site]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=23134OpenIGTLink2008-03-24T15:45:48Z<p>Csoma: </p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. ([[OpenIGTLink/Protocol/JHUBRP | Robot IGT]] )<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Open IGT Link INterface for 3D Slicer]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]<br />
* [http://lcsr.jhu.edu/OpenIGTLink A backup of this site]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=23133OpenIGTLink2008-03-24T15:45:24Z<p>Csoma: </p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. ([[OpenIGTLink/Protocol/JHUBRP | Robot IGT]])<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Open IGT Link INterface for 3D Slicer]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]<br />
* [http://lcsr.jhu.edu/OpenIGTLink A backup of this site]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=23132OpenIGTLink2008-03-24T15:27:26Z<p>Csoma: /* Resources */</p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. (Robot IGT)<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Open IGT Link INterface for 3D Slicer]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]<br />
* [http://lcsr.jhu.edu/OpenIGTLink A backup of this site]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Slicer&diff=23131OpenIGTLink/Slicer2008-03-24T15:21:48Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=People=<br />
* Junichi Tokuda<br />
* Haiying Liu<br />
<br />
=Current Implementation=<br />
*Open IGT Link is implemented in the similar way as Slicer Daemon<br />
*The source cede is available from Slicer3 IGT branch<br />
<br />
=TODO=<br />
*OpenIGTLink Client<br />
**Most of devices (e.g. MR scanner, robot) are waiting for connection from navigation software<br />
**Slicer needs GUI interface to set up address/port for OpenIGTLink connection<br />
*Data export through OpenIGTLink<br />
**Each module send out image/coordinate data through MRML node<br />
***OpenIGTLink module monitors MRML nodes<br />
*Connection Management Interface on Slicer 3<br />
*Connection to IGSTK<br />
**IGSTK only supports Tracker Daemon<br />
*Integration with clinical modules<br />
**NeuroNav<br />
**ProstateNav modules</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22777OpenIGTLink/Protocol2008-03-10T14:04:06Z<p>Csoma: /* STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented / Unknown command received)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name)<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22776OpenIGTLink/Protocol2008-03-10T14:03:34Z<p>Csoma: /* STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Any STATUS that's not 1 (OK) should be logged by the receiver.<br />
<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 Invalid packet - 0 is not used<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
20 Unknown command received<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name)<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22775OpenIGTLink/Protocol2008-03-10T14:01:37Z<p>Csoma: /* Data types */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
== GET_STATUS ==<br />
Parameters: none (BODY_SIZE=0)<br /><br />
Response: one STATUS packet for each implemented device<br />
<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name)<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22774OpenIGTLink/Protocol/JHUBRP2008-03-10T14:01:01Z<p>Csoma: /* Query: GET_STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
'''This was moved to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22773OpenIGTLink/Protocol/JHUBRP2008-03-10T14:00:51Z<p>Csoma: /* Query: GET_STATUS */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
'''This was move to the generic header''' implemented by every device!<br /><br />
Parameters: none<br /><br />
Robot: Respond with STATUS packet<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Meetings&diff=22490OpenIGTLink/Meetings2008-02-29T19:39:08Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
= Meetings =<br />
* [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Visit_to_BWH_Feb2008 February 27-29, 2008 - BWH, JHU, Acusticmed] &nbsp;meeting of [http://wiki.ncigt.org/index.php/U41:Prostate:BRP_Robotics_Project_Page JHU Transperineal Robot project]<br />
** [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Visit_to_BWH_Feb2008#Follow_Up_.2F_To_Do_List Follow up/To Do list]<br />
** [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Meeting_26Feb08 Before meeting TCon]<br />
** [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Meeting_5Feb08 February 5, 2008 - Preparation for the experiment at BWH]<br />
* [[Slicer/Features/Middleware | December 14, 2007 - Middleware features discussion]] at [[2007_December_Slicer_IGT_Programming | Slicer IGT Programming week]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting June 27, 2007 - Initial discussion about requirements]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Meetings&diff=22489OpenIGTLink/Meetings2008-02-29T19:35:19Z<p>Csoma: New page: * [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Visit_to_BWH_Feb2008 February 27-29, 2008 - BWH, JHU, Acusticmed] &nbsp;meeting of [http://wiki.ncigt.org/index.php/U41:Prostate:...</p>
<hr />
<div>* [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Visit_to_BWH_Feb2008 February 27-29, 2008 - BWH, JHU, Acusticmed] &nbsp;meeting of [http://wiki.ncigt.org/index.php/U41:Prostate:BRP_Robotics_Project_Page JHU Transperineal Robot project] &nbsp; (Before meeting [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Meeting_26Feb08 TCon])<br />
* [http://wiki.ncigt.org/index.php/U41:Prostate:BRP:Events:Meeting_5Feb08 February 5, 2008 - Preparation for the experiment at BWH]<br />
* [[Slicer/Features/Middleware | December 14, 2007 - Middleware features discussion]] at [[2007_December_Slicer_IGT_Programming | Slicer IGT Programming week]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting June 27, 2007 - Initial discussion about requirements]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22488OpenIGTLink/Protocol2008-02-29T19:35:15Z<p>Csoma: /* Resources */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name)<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=22487OpenIGTLink2008-02-29T19:27:21Z<p>Csoma: /* Protocol and implementations */</p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. (Robot IGT)<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Slicer Daemon]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=22486OpenIGTLink2008-02-29T19:24:21Z<p>Csoma: /* Resources */</p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. (Robot IGT)<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Slicer Daemon]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
* [[OpenIGTLink/Library/Build | Library building instructions]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]<br />
* [[OpenIGTLink/Meetings | Meetings concerning Open IGT Link ]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22480OpenIGTLink/Protocol/JHUBRP2008-02-29T06:13:11Z<p>Csoma: /* Response: COORDINATES */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z) [X_offset, Y_offset, Z_offset + InsertionDepth]<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22479OpenIGTLink/Protocol/JHUBRP2008-02-29T06:05:26Z<p>Csoma: /* Response: COORDINATES */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): needle offset (to calculate Depth from Z)<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22478OpenIGTLink/Protocol/JHUBRP2008-02-29T05:42:35Z<p>Csoma: /* Command: MOVE_TO */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats (3x4): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4): orientation quaternion<br />
Robot: Go to this coordinate - position, orientation (later: speed?)<br />
<br />
Global RAS coordinate system).<br />
<br />
Robot responds with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): current insertion depth offset<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22477OpenIGTLink/Protocol/JHUBRP2008-02-29T05:41:06Z<p>Csoma: /* Response: COORDINATES */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats (3x4 bytes): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 bytes): orientation quaternion<br />
* Three 32 bit floats (3x4 byte): current insertion depth offset<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22476OpenIGTLink/Protocol/JHUBRP2008-02-29T05:37:04Z<p>Csoma: /* Command: SET_Z_FRAME */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (28 byte total):<br />
* Vector of three 32 bit floats (3x4 byte): position X, Y, Z<br />
* Vector of four 32 bit floats (4x4 byte): orientation quaternion - normalized!<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
* One 32 bit float: current insertion depth<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22465OpenIGTLink/Protocol2008-02-28T15:33:56Z<p>Csoma: /* Open questions */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we have packet types?<br>-keep only the last (position)<br>- all important (command)<br>- high priority (emergency)<br><br />
# Priority<br />
# Authentication (other than Unique Name)<br />
# Compression?<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer/Features/Middleware | Middleware features discussion]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22464OpenIGTLink/Protocol2008-02-28T15:31:40Z<p>Csoma: /* JHU BRP Robot protocol */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
[[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we add "keep only the last" flag to the packet type?<br />
# Authentication (other than Unique Name)<br />
# Compression<br />
# Priority<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer/Features/Middleware | Middleware features discussion]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22463OpenIGTLink/Protocol2008-02-28T15:30:19Z<p>Csoma: /* POSITION */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit (3x4 byte) floats: position X, Y, Z<br />
* Vector of three 32 bit (3x4 byte) floats: orientation<br />
The orientation is optional, if not used the values are (1,0,0)<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| x | y | z | ox | oy | oz |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
Includes:<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we add "keep only the last" flag to the packet type?<br />
# Authentication (other than Unique Name)<br />
# Compression<br />
# Priority<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer/Features/Middleware | Middleware features discussion]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22462OpenIGTLink/Protocol2008-02-28T15:24:50Z<p>Csoma: /* TRANSFORM */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Each element is a 4 byte (32 bit) float, 12x4 = 48 byte in total.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
* 3D Position<br />
* Optional: Orientation<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
Includes:<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we add "keep only the last" flag to the packet type?<br />
# Authentication (other than Unique Name)<br />
# Compression<br />
# Priority<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer/Features/Middleware | Middleware features discussion]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol&diff=22461OpenIGTLink/Protocol2008-02-28T15:20:15Z<p>Csoma: /* Overview */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]]<br />
<br />
<br />
=Overview=<br />
Every message transfered from a sender to a receiver through OpenIGTLink communication consists of the header byte array<br />
followed by the body.<br />
<br />
The header contains type string and size of the body, which helps receiver to interpret the body.<br />
<br />
The type string may be one of the names defined in OpenIGTLink protocol specification (this page) or a name defined by a user.<br />
<br />
The sender does not need to care whether the receiver can interpret the data type, since the receiver can skip reading the body as long as the body size information in the header is correct.<br />
<br />
The header also contains device name. This would be helpful when the sender sends same type of data acquired from multiple sources.<br />
For example, if the sender has multi-channel tracking device, sender can assign different name to each channel, then the receiver can recognize from which channel data has been acquired.<br />
<br />
Details of the header and body structures are defined in following sections.<br />
<br />
=Client - Server=<br />
A device (scanner, tracker) exposing functionality and executing commands is usually the Server. Once started will stand by listening for connection requests.<br />
<br />
A Client (for ex. a PC) usually connects to multiple devices and coordinates the whole process.<br />
<br />
=Header Structure=<br />
Bytes<br />
0 2 14 34 42 50 58<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
| V | TYPE | DEVICE_NAME | TIME_STAMP | BODY_SIZE | CRC64 | BODY <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.....<br />
<br />
==Byte Order==<br />
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).<br />
<br />
==Header Fields==<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Version number (1)<br />
|-<br />
| align="left" | TYPE<br />
| align="left" | char[12]<br />
| align="left" | Type name of data<br />
|-<br />
| align="left" | DEVICE_NAME<br />
| align="left" | char[20]<br />
| align="left" | Unique device name<br />
|-<br />
| align="left" | TIME_STAMP<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | [[OpenIGTLink/Timestamp | Timestamp]] or 0 if unused<br />
|-<br />
| align="left" | BODY_SIZE<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | Size of body in bytes<br />
|-<br />
| align="left" | CRC<br />
| align="left" | 64 bit unsigned int<br />
| align="left" | 64 bit CRC for body data<br />
|-<br />
|}<br />
<br />
= Data types =<br />
Data type:<br />
* Command (get position, get status, go to target, stop, start continuous push, stop push, ready)<br />
* Data (image, position, status)<br />
<br />
<br />
==IMAGE==<br />
Bytes<br />
58 60 62 64 70 82 94 106 118<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| V |T|S|E|O|RI |RJ |RK | TX | TY | TZ | SX | SY | SZ | NX | NY | NZ | PX | PY | PZ |<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
118 124 130<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
|DI |DJ |DK |DRI|DRJ|DRK| IMAGE_DATA<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+....<br />
<br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | V<br />
| align="left" | unsigned short<br />
| align="left" | version number<br />
|-<br />
| align="left" | T<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Image type (1: Scalar)<br />
|-<br />
| align="left" | S<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Scalar type (2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)<br />
|-<br />
| align="left" | E<br />
| align="left" | 8bit unsigned int<br />
| align="left" | Endian for image data (1:BIG 2:LITTLE) (NOTE: values in image header is fixed to BIG endian)<br />
|-<br />
| align="left" | O<br />
| align="left" | 8bit unsigned int<br />
| align="left" | image coordinate (1:RAS 2:LPS)<br />
|-<br />
| align="left" | RI, RJ, RK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Number of pixels in each direction<br />
|-<br />
| align="left" | PX, PY, PZ<br />
| align="left" | 32 bit float<br />
| align="left" | center position of the image<br />
|-<br />
| align="left" | TX, TY, TZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | SX, SY, SZ<br />
| align="left" | 32 bit float<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | NX, NY, NZ<br />
| align="left" | 32 bit float<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | DI, DJ, DK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | Starting index of subvolume<br />
|-<br />
| align="left" | DRI, DRJ, DRK<br />
| align="left" | 16 bit unsigned int<br />
| align="left" | number of pixels of subvolume<br />
|-<br />
| align="left" | IMAGE_DATA<br />
| align="left" | Binary image data ()<br />
| align="left" | Image data (endian is determined by "E" field)<br />
|-<br />
|}<br />
<br />
<!--<br />
Image data consists of ascii header information followed by binary image pixel data.<br />
(Ascii header is used to maintain compatibility with SlicerDaemon connection)<br />
<br />
space right-anterior-superior\n<br />
dimensions <xsize> <ysize> <zsize>\n<br />
space_origin (<x>, <y>, <z>)\n<br />
space_directions (<tx>, <ty>, <tz>) (<sx>, <sy>, <sz>) (<nx>, <ny>, <nz>) \n<br />
kinds space space space\n<br />
components 1\n<br />
scalar_type <scalar type #>\n<br />
<binary image data><br />
<br />
Descriptions:<br />
{| border="1" cellpadding="5" cellspacing="0" align="center"<br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | <xsize>, <ysize>, <zsize><br />
| align="left" | text number (real)<br />
| align="left" | Center position of the image in RAS coordinate<br />
|-<br />
| align="left" | <tx>, <ty>, <tz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'i' index) / The length represents pixel size in 'i' direction<br />
|-<br />
| align="left" | <sx>, <sy>, <sz><br />
| align="left" | text number (real)<br />
| align="left" | Transverse vector (direction for 'j' index) / The length represents pixel size in 'j' direction<br />
|-<br />
| align="left" | <nx>, <ny>, <nz><br />
| align="left" | text number (real)<br />
| align="left" | Normal vector of image plane(direction for 'k' index) / The length represents pixel size in 'z' direction or slice thickness<br />
|-<br />
| align="left" | <scalar type #><br />
| align="left" | Pixel scalar type number (Ascii)<br />
| align="left" | 2:int8 3:int8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64<br />
|-<br />
| align="left" | <binary image data><br />
| align="left" | Binary image data (<xsize>*<ysize>*<zsize>* (pixel size)<br />
| align="left" | Image data<br />
|-<br />
|}<br />
--><br />
<br />
==TRANSFORM==<br />
The transform data is upper three rows of 4x4 transformation matrix, where element (3,3) is assumed to be 1.<br />
<br />
Bytes (Body)<br />
58 62 66 70 74 78 82 86 90 94 98 102 106<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| (0,0) | (1,0) | (2,0) | (0,1) | (1,1) | (2,1) | (0,2) | (1,2) | (2,2) | (0,3) | (1,3) | (2,3) | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
==POSITION==<br />
* 3D Position<br />
* Optional: Orientation<br />
<br />
==STATUS==<br />
Bytes (Body)<br />
58 60 68 88<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
| C | Sub Code | Status name | Status message (optional)<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+.....<br />
<br />
{| border="1" cellpadding="5" cellspacing="0" <br />
|-<br />
| align="left style="background:#e0e0e0;" | Data<br />
| align="left style="background:#e0e0e0;" | Type<br />
| align="left style="background:#e0e0e0;" | Description<br />
|-<br />
| align="left" | C<br />
| align="left" | Unsigned short (16bit)<br />
| align="left" | Status code groups: 1-Ok, 2-Generic Error, ... (see below)<br />
|-<br />
| align="left" | Sub Code<br />
| align="left" | 64 bit integer<br />
| align="left" | Sub code for the error (ex. 0x200 - file not found)<br />
|-<br />
| align="left" | Error name<br />
| align="left" | char[20]<br />
| align="left" | "Error", "Ok", "Starting up" - can be anything, don't relay on this<br />
|-<br />
| align="left" | Status Message (optional)<br />
| align="left" | char[ BodySize - 30 ]<br />
| align="left" | Optional (English) description (ex. "File C:\test.ini not found")<br />
|-<br />
|}<br />
<br />
<br />
'''Status codes:'''<br /><br />
0 No Errors Found (use status 1 instead!)<br /><br />
1 OK (Default status)<br /><br />
2 Unknown error<br /><br />
3 Panic mode (emergency)<br /><br />
4 Not found (file, configuration, device etc)<br /><br />
5 Access denied<br /><br />
6 Busy<br /><br />
7 Time out / Connection lost<br /><br />
8 Overflow / Can't be reached<br /><br />
9 Checksum error<br /><br />
10 Configuration error<br /><br />
11 Not enough resource (memory, storage etc)<br /><br />
12 Illegal/Unknown instruction (or feature not implemented)<br /><br />
13 Device not ready (starting up)<br /><br />
14 Manual mode (device does not accept commands)<br /><br />
15 Device disabled<br /><br />
16 Device not present<br /><br />
17 Device version not known<br /><br />
18 Hardware failure<br /><br />
19 Exiting / shut down in progress<br /><br />
<br /><br />
<br />
= JHU BRP Robot protocol =<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU BRP Robot protocol description]]<br />
Includes:<br />
* Set Workphase (Slicer -> Robot)<br />
* Query and Command (Slicer -> Robot)<br />
* Responses (Robot -> Slicer)<br />
<br />
= Open questions =<br />
# What if the application receives hundreds of "position" packets? <br> Should we add "keep only the last" flag to the packet type?<br />
# Authentication (other than Unique Name)<br />
# Compression<br />
# Priority<br />
# Duplicate messages<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer/Features/Middleware | Middleware features discussion]]<br />
* [http://www.cisst.org/wiki/MRI_robot/MIT_2007_06_27_Meeting Initial discussion about requirements]<br />
* [http://www.bioimagesuite.org/public/VVLink.html BioImage Suite VVLink Tool] (uses TCL/TK object streaming)</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22439OpenIGTLink/Protocol/JHUBRP2008-02-26T02:37:10Z<p>Csoma: /* Mimimum command set */</p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
* One 32 bit float: current insertion depth<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Query:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Query:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink&diff=22386OpenIGTLink2008-02-21T15:19:14Z<p>Csoma: /* Devices */</p>
<hr />
<div><div class="floatright">__TOC__</div><br />
= Overview =<br />
'''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 also accept commands. (Robot IGT)<br />
<br />
This is a generalization of the previous [[Tracker Daemon]].<br />
<br />
= Devices =<br />
<br />
* MRI real time image (currently supporting GE, planning to invite other vendors)<br />
* [[OpenIGTLink/Protocol/JHUBRP | JHU robots and encoders]] - [http://www.cisst.org/wiki/MRI_Robot JHU page]<br />
* List all devices supported by IGSTK<br />
* Aurora<br />
* [http://www.ndigital.com/ Optotrack]<br />
*FlockOfBirds<br />
*Polaris<br />
<br />
* future:<br />
** commercial naviation system<br />
** other open source effort (Siemens)<br />
<br />
(Please contact us if you would like to include other devices.)<br />
<br />
=Protocol and implementations =<br />
Based on simple TCP/IP protocol that can be directly accessed through sockets.<br />
* [[OpenIGTLink/Protocol | Open IGT Link Protocol description]] <br />
* [[OpenIGTLink/Slicer | Slicer Daemon]] <br />
* [[OpenIGTLink/Library | Functions for the protocol (library)]]<br />
* [[OpenIGTLink/Library/Build | Library building instructions]]<br />
<br />
=People / Organizations=<br />
* [http://www.kitware.com/profile/team/ibanez.html Luis Ibanez], Kitware<br />
* [http://www.spl.harvard.edu/pages/People/tokuda Junichi Tokuda], BWH<br />
* [http://www.cisst.org/wiki/User:Csoma Csaba Csoma], JHU<br />
* Jack Blevins, Acousticmed<br />
* Patrick Cheng, Georgetown University<br />
* [http://www.spl.harvard.edu/pages/People/hliu Haying Liu], BWH<br />
* [http://www.insightsoftwareconsortium.org/ Insight Software Consortium]<br />
* [http://www.na-mic.org/ National Alliance for Medical Image Computing (NA-MIC)]<br />
*[http://www.intelli-si.org Intelligent Surgical Instrument Project] sponsored by The Ministry of International Trade and Industry, Japan<br />
*Jumpei Arata, Nagoya Institute of Technology, Japan (robot control)<br />
<br />
= License=<br />
[http://www.opensource.org/licenses/bsd-license.php New BSD license] &copy;2008 Insight Software Consortium<br /><br />
<br />
<br />
= Resources =<br />
* [[Slicer3:_Image_Guided_Therapy_(IGT) | Slicer 3 Image Guided Therapy (IGT) suite ]]<br />
* [[Slicer3:Slicer_Daemon | Slicer 3 Daemon]]<br />
* [[Tracker Daemon]]<br />
* [http://www.opendmtp.org/ OpenDMTP] - Open Device Monitoring and Tracking Protocol<br />
* [http://en.wikipedia.org/wiki/Uniform_Driver_Interface Uniform Driver Interface (UDI)]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22264OpenIGTLink/Protocol/JHUBRP2008-02-14T21:19:59Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
* One 32 bit float: current insertion depth<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP | START_UP]] Internally calls the INITIALIZE command.<br />
# [[#Command:_SET_Z_FRAME | SET_Z_FRAME]] Stores the Z-Frame.<br />
# [[#TARGETING | TARGETING]] Just checks the Z-Frame values.<br />
# [[#Command:_MOVE_TO | MOVE_TO]] Repeat this command for each target.<br />
# [[#MANUAL | MANUAL]] Changes to Manual insertion. Switch back to automatic by calling TARGETING.<br />
# [[#Command:_INSERT | INSERT]] Automatic insertion. Not yet implemented on the hardware.<br />
# [[#Command:_BIOPSY | BIOPSY]] Takes the biopsy automatically, see INSERT.<br />
# [[#Command:_HOME | HOME]] Ex. after manual insertion to change the biopsy gun.<br />
# [[#EMERGENCY | EMERGENCY]] If something is wrong. To get out of this state START_UP needs to be called again.<br />
# [[#Command:_GET_COORDINATE | GET_COORDINATE]] Call this as often as needed to get the latest position of the robot.<br />
# [[#Command:_GET_STATUS | GET_STATUS]] Will respond with OK or other status - again, called often.<br />
<br />
Response from the robot:<br />
# [[#Status:_STATUS | STATUS]]<br />
# [[#Response:_COORDINATES | COORDINATES]]</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22263OpenIGTLink/Protocol/JHUBRP2008-02-14T21:13:38Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
* One 32 bit float: current insertion depth<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# [[#START_UP]] (internally calls INITIALIZE)<br />
# SET_Z_FRAME<br />
# TARGETING (will not do much, just check the Z-Frame values)<br />
# MOVE_TO (repeat for each target)<br />
# MANUAL (changes to Manual insertion, switch back to automatic by calling TARGETING)<br />
# INSERT (Automatic insertion. We're not sure when this will be implemented on the hardware.)<br />
# BIOPSY (Takes the biopsy automatically, see #6)<br />
# HOME (Ex. after manual insertion to change the biopsy gun)<br />
# EMERGENCY (if something is wrong. To get out of this state START_UP needs to be called again)<br />
# GET_COORDINATE (call is as often as needed for the latest position of the robot)<br />
# GET_STATUS (will respond with OK or other status - again, called often)<br />
<br />
Response from the robot:<br />
# STATUS<br />
# COORDINATES</div>Csomahttps://www.na-mic.org/w/index.php?title=OpenIGTLink/Protocol/JHUBRP&diff=22262OpenIGTLink/Protocol/JHUBRP2008-02-14T21:12:21Z<p>Csoma: </p>
<hr />
<div>[[OpenIGTLink | &lt;&lt; OpenIGTLink]] | [[OpenIGTLink/Protocol | Protocol]]<br />
<br />
<br />
<div class="redirectText">'''JHU BRP Robot protocol description'''</div><br />
<div class="floatright">__TOC__</div><br />
<br />
<br />
= System Diagram =<br />
<div class="center">[[Image:MRI_Robot_System_Diagram2.png]]</div><br />
<br />
= Workflow =<br />
# Scanner: Scout image acquisition with the landmark close to the prostate<br />
# Navigation soft and scanner: Calculate Z-frame position, scan a slice through the Z-frame<br />
# Repeat previous step if the Z-frame is not visible enough to register the robot<br />
# Scanner: 3D volume acquisition of the prostate<br />
# Navigation soft: Select (or import) the targets, show needle path, allow modification<br />
# Navigation soft: Calculate the target and path, send it to the robot<br />
# Robot: Execute command<br />
# [Optional] Navigation soft: send current robot coordinates to the Real Time scanner IO for needle tracking, display image<br />
# Navigation soft: Display robot position and status<br />
# Scanner: Confirm robot location before biopsy<br />
# Manual: Insert biopsy needle<br />
# [Optional] Navigation soft: show Real time images of the needle insertion<br />
# Manual: Fire biopsy gun<br />
<br />
= Open IGT Link Protocol =<br />
<br />
Some commands / queries are expecting parameters in the Body section which follows the [[OpenIGTLink/Protocol#Header_Structure | Header Structure]]. The parameter can be:<br />
* 8 bit Byte<br />
* 32 bit Integer<br />
* 32 bit Float<br />
<br />
For example the Position and Orientation parameters in SET_Z_FRAME command will be the following.<br />
Bytes (Body)<br />
58 62 66 70 74 78 82<br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
| X | Y | Z | Ox | Oy | Oz | <br />
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br />
<br />
<br />
= Set Workphase (Slicer -> Robot) =<br />
<br />
There are no parameters for this commands.<br />
<br />
== START_UP ==<br />
Slicer: Send "START_UP" Workphase command<br /><br />
Robot: Initialize robot (INITIALIZE command) and respond with status message<br />
<br />
== PLANNING ==<br />
Robot: Do nothing, respond with status<br />
<br />
== CALIBRATION ==<br />
Robot: Do nothing, respond with status. Waiting for SET_Z_FRAME command (Z-Frame transformation).<br />
<br />
== TARGETING ==<br />
Robot: Fail if Z-Frame was not set. Respond with status. Waiting for targets (MOVE command).<br />
<br />
== MANUAL ==<br />
Robot: Engage breaks, responds with status. <br /><br />
Slicer sends "GetCoordinate" query periodically to update the display.<br />
<br />
== EMERGENCY ==<br />
Robot: Responds with status<br />
<br />
<br />
= Command / Query (Slicer -> Robot) =<br />
<br />
== Command: INITIALIZE ==<br />
Parameters: none<br /><br />
Robot: Initialize, set the encoders, remember this position as "HOME". Respond with status.<br />
<br />
== Command: SET_Z_FRAME ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Store Z-frame position and orientation (global RAS coordinate system) - respond with status.<br />
<br />
== Command: MOVE_TO ==<br />
Parameters (24 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
Robot: Go to this coordinate - position, orientation (later: speed?) (global RAS coordinate system). Respond with status.<br />
<br />
== Command: INSERT ==<br />
Parameters (4 byte): 32 bit float<br /><br />
Robot: Insert the needle to this depth - float (in mm)<br />
<br />
== Command: BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Take biopsy (Retract Cannula)<br />
<br />
== Command: HOME ==<br />
Parameters: none<br /><br />
Robot: Go to Home (collapses the robot to remove/replace needle)<br />
<br />
== Command: STOP ==<br />
Parameters: none<br /><br />
Robot: Stop moving<br />
<br />
== Command: E_STOP ==<br />
Parameters: none<br /><br />
Robot: Emergency Stop (stop + purges the air lines)<br />
<br />
== Command: SET_JOINT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Positions - float[max.16] - move joint here<br />
<br />
== Command: SET_VELOCITY ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: Set Joint Velocities - float[max.16] - move joint with this speed<br />
<br />
== Command: SET_VOLTAGE_OUTPUT ==<br />
Parameters: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br /><br />
Robot: sets the air pressure / voltage output<br />
<br />
== Command: LOCK ==<br />
Parameters: none<br /><br />
Robot: Engage brakes - all of them<br />
<br />
== Command: UNLOCK ==<br />
Parameters: none<br /><br />
Robot: Unlock - disengage all the brakes so the robot can be moved manually<br />
<br />
== Command: LOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Engage brakes on a give axis<br />
<br />
== Command: UNLOCK_AXIS ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Unlock - disengage the brakes on a give axis, so it can be moved manually<br />
<br />
== Command: LIMIT_VELOCITY==<br />
Parameters: one 32 bit float<br /><br />
Robot: Set entire robot velocity limit in Robot Coords. - float (like 10 mm/s) <br />
<br />
== Query: GET_COORDINATE ==<br />
Parameters: none<br /><br />
Robot: Respond with current coordinate (position and orientation in global RAS coordinate system)<br />
<br />
== Query: GET_STATUS ==<br />
Parameters: none<br /><br />
Robot: Respond with status (see the packet description below)<br />
<br />
== Query: GET_BIOPSY ==<br />
Parameters: none<br /><br />
Robot: Respond with Actual Insertion Depth <br />
<br />
== Query: GET_NR_JOINT ==<br />
Parameters: none<br /><br />
Robot: Get Number of Joints - integer, see the description below<br />
<br />
== Query: GET_JOINT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Positions<br />
<br />
== Query: GET_VELOCITY==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Velocities<br />
<br />
== Query: GET_VOLTAGE_OUTPUT ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Air Pressures<br />
<br />
== Query: GET_JOINT_TRACK ==<br />
Parameters: one or more 32bit integers (BODY_SIZE/4)<br /><br />
Robot: Get Actual Joint Tracking Errors<br />
<br />
== Query: GET_BRAKE ==<br />
Parameters: none<br /><br />
Robot: Get Brakes status<br />
<br />
== Query: GET_MOVING ==<br />
Parameters: none<br /><br />
Robot: Get Joint Moving status<br />
<br />
= Responses sent by the robot (Robot -> Slicer) =<br />
<br />
== Status: STATUS ==<br />
Response from Robot: Robot done moving, Error message, Emergency stop<br /><br />
See [[OpenIGTLink/Protocol#STATUS]] for description.<br />
<br />
== Status: BRAKES ==<br />
Response from Robot: Brake status - boolean[max.16] - true(locked)/false(loose) for each joint<br /><br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Status: DONE_MOVING ==<br />
Response from Robot: Done moving/joint - boolean[max.16] - true/false for each joint<br />
Structure: a number of bytes, defied by BODY_SIZE. 0 means false, 1 means true.<br />
<br />
== Response: COORDINATES ==<br />
Response from Robot: Actual coordinates and insertion depth - 6DOF in global RAS coordinate system<br /><br />
Structure (28 byte total):<br />
* Vector of three 32 bit floats: position X, Y, Z<br />
* Vector of three 32 bit floats: orientation<br />
* One 32 bit float: current insertion depth<br />
<br />
== Response: JOINTS ==<br />
Response from Robot: Number of Joints - integer<br /><br />
Structure: one 32 bit integer (4 bytes total)<br />
<br />
== Response: JOINT_POS ==<br />
Response from Robot: Actual joint positions - float[max.16] (joint positions in mm)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_VEL ==<br />
Response from Robot: Actual joint velocities - float[max.16] (joint velocities in mm/s)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: JOINT_TRACK ==<br />
Response from Robot: Actual joint tracking error - float[max.16] - "actual joint position" - "set joint position"<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
== Response: AIR_PRESSURE ==<br />
Response from Robot: Actual air pressures - float[max.32] - '''two per joint!''' (PSI for each valve)<br /><br />
Structure: a set of 32bit floats. The number of floats is BODY_SIZE/4.<br />
<br />
= Mimimum command set =<br />
Command to the robot:<br />
# START_UP (internally calls INITIALIZE)<br />
# SET_Z_FRAME<br />
# TARGETING (will not do much, just check the Z-Frame values)<br />
# MOVE_TO (repeat for each target)<br />
# MANUAL (changes to Manual insertion, switch back to automatic by calling TARGETING)<br />
# INSERT (Automatic insertion. We're not sure when this will be implemented on the hardware.)<br />
# BIOPSY (Takes the biopsy automatically, see #6)<br />
# HOME (Ex. after manual insertion to change the biopsy gun)<br />
# EMERGENCY (if something is wrong. To get out of this state START_UP needs to be called again)<br />
# GET_COORDINATE (call is as often as needed for the latest position of the robot)<br />
# GET_STATUS (will respond with OK or other status - again, called often)<br />
<br />
Response from the robot:<br />
# STATUS<br />
# COORDINATES</div>Csoma