Difference between revisions of "OpenIGTLink/ProtocolV2/Type/Bind"

From NAMIC Wiki
Jump to: navigation, search
(Created page with ' << Version 2 Draft Page =Summary= Bind message format is designed to bind any OpenIGTLink messages into a single message. This message f…')
 
Line 89: Line 89:
 
| align="left style="background:#e0e0e0;" | Type
 
| align="left style="background:#e0e0e0;" | Type
 
| align="left style="background:#e0e0e0;" | Description
 
| align="left style="background:#e0e0e0;" | Description
 +
|-
 +
| colspan=3 align="left" style="background:#e0e0e0;" |Bind Header Section
 
|-
 
|-
 
| align="left" | NELEMENTS
 
| align="left" | NELEMENTS
 
| align="left" | uint16
 
| align="left" | uint16
 
| align="left" | Number of elements
 
| align="left" | Number of elements
|-
 
| colspan=3 align="left" style="background:#e0e0e0;" |Bind Hearder
 
 
|-
 
|-
 
| align="left" | TYPE 0
 
| align="left" | TYPE 0
Line 109: Line 109:
 
|-
 
|-
 
| colspan=3 align="left" style="background:#f0f0f0;"|...
 
| colspan=3 align="left" style="background:#f0f0f0;"|...
|-
 
| colspan=3 align="left" style="background:#e0e0e0;" |FORMAT (NELEMENTS-1)
 
 
|-
 
|-
 
| align="left" | TYPE (NELEMENTS-1)
 
| align="left" | TYPE (NELEMENTS-1)

Revision as of 16:05, 18 November 2010

Home < OpenIGTLink < ProtocolV2 < Type < Bind

<< Version 2 Draft Page

Summary

Bind message format is designed to bind any OpenIGTLink messages into a single message. This message format is useful, when one needs to care about synchronization of multiple data (e.g. multi-channel sensors), or sending associative array (pairs of key string and value). The bind message format consists of the bind header section, the name table section and the data section.

Message Types

BIND

Data Type Description
NELEMENTS uint16 Number of elements
Bind Header Section
TYPE 0 char[12] Data type (OpenIGTLink Device Type string)
NAMELEN 0 uint 8 Name length
DATA SIZE 0 uint 64 Data size
...
TYPE (NELEMENTS-1) char[12] Data type (OpenIGTLink Device Type string)
NAMELEN (NELEMENTS-1) uint 8 Name length
DATA SIZE (NELEMENTS-1) uint 64 Data size
NAME Table Section
NAME 0 char[NAMELEN] Name
...
NAME (NELEMENTS-1) char[NAMELEN (NELEMENTS-1)] Name
Padding* uint8 or none padding to align DATA with WORD
Data Section
DATA 0 TYPE 0 [ SIZE 0 ] Data array
DATA 1 TYPE 1 [ SIZE 1 ] Data array
...
DATA (NELEMENTS-1) TYPE (NELEMENTS-1) [SIZE (NELEMENTS -1)] Data array

In C/C++, the size of padding is determined by:

((NAMELEN0 + NAMELEN1 + ... ) % 2 == 0) ? 0 : 1

GET_BIND

GET_BIND is used to request the receiver for associative array data. If a GET_BIND message does not have a body, it requests all data.

Data Type Description
Bind Header Section
NELEMENTS uint16 Number of elements
TYPE 0 char[12] Data type (OpenIGTLink device type string)
NAMELEN 0 uint 8 Name length
SIZE 0 uint 16 Data length
...
TYPE (NELEMENTS-1) uint8 Data type (0: string, 1: scalar, 2: vector)
NAMELEN (NELEMENTS-1) uint 8 Name length
SIZE (NELEMENTS-1) uint 16 Data length
NAME Table
NAME 0 char[NAMELEN] Name
...
NAME (NELEMENTS-1) char[NAMELEN (NELEMENTS-1)] Name

STT_AARRAY

Same as GET_AARRAY.

STP_AARRAY

Data Type Description

RTS_AARRAY

Implementations

The AARRAY message type is implemented in the following source code.

Contributors

Junichi Tokuda, Yuichiro Hayashi

Comments