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

From NAMIC Wiki
Jump to: navigation, search
Line 20: Line 20:
 
| align="left" | TYPE 0
 
| align="left" | TYPE 0
 
| align="left" | uint8
 
| align="left" | uint8
| align="left" | Data type (0: string, 1: scalar, 2: vector)
+
| align="left" | Data type (0: string 2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)
 
|-
 
|-
 
| align="left" | NAMELEN 0
 
| align="left" | NAMELEN 0
 
| align="left" | uint 8
 
| align="left" | uint 8
 
| align="left" | Name length
 
| align="left" | Name length
 +
|-
 +
| align="left" | SIZE 0
 +
| align="left" | uint 16
 +
| align="left" | Data length
 
|-
 
|-
 
| colspan=3 align="left" style="background:#f0f0f0;"|...
 
| colspan=3 align="left" style="background:#f0f0f0;"|...
Line 37: Line 41:
 
| align="left" | uint 8
 
| align="left" | uint 8
 
| align="left" | Name length
 
| align="left" | Name length
 +
|-
 +
| align="left" | SIZE (NELEMENTS-1)
 +
| align="left" | uint 16
 +
| align="left" | Data length
 
|-
 
|-
 
| colspan=3 align="left" style="background:#e0e0e0;" |NAME Table
 
| colspan=3 align="left" style="background:#e0e0e0;" |NAME Table
Line 57: Line 65:
 
|-
 
|-
 
| align="left" | DATA 0
 
| align="left" | DATA 0
| align="left" | TYPE 0
+
| align="left" | TYPE 0 [ SIZE 0 ]
 
| align="left" | Data content
 
| align="left" | Data content
 
|-
 
|-
 
| align="left" | DATA 1
 
| align="left" | DATA 1
| align="left" | TYPE 1
+
| align="left" | TYPE 1 [ SIZE 1 ]
 
| align="left" | Data content
 
| align="left" | Data content
 
|-
 
|-
Line 67: Line 75:
 
|-
 
|-
 
| align="left" | DATA (NELEMENTS-1)
 
| align="left" | DATA (NELEMENTS-1)
| align="left" | TYPE (NELEMENTS-1)
+
| align="left" | TYPE (NELEMENTS-1) [SIZE (NELEMENTS -1)]
 
| align="left" | Data content
 
| align="left" | Data content
 
|-
 
|-

Revision as of 22:30, 17 November 2010

Home < OpenIGTLink < ProtocolV2 < Type < AssociativeArray

<< Version 2 Draft Page

Summary

Associative Array type is designed to transfer multiple pairs of key and values (associative array) to the receiver. The message format supports key as an array of ASCII code with length less than 255 bytes, and value as an N-dimensional array of 8-, 16-, 32- and 64-bit singed and unsigned integer and 32- and 64-bit float. Maximum 255 dimensions is supported and up to 65536 pairs can be listed in the format. The format consists of data table, which specifies type and size of keys and values, followed by an array of key strings and values.

Message Types

AARRAY

Data Type Description
NELEMENTS uint16 Number of elements
FORMAT 0
TYPE 0 uint8 Data type (0: string 2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64)
NAMELEN 0 uint 8 Name length
SIZE 0 uint 16 Data length
...
FORMAT (NELEMENTS-1)
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
Padding* uint8 or none padding to align DATA with WORD
DATA
DATA 0 TYPE 0 [ SIZE 0 ] Data content
DATA 1 TYPE 1 [ SIZE 1 ] Data content
...
DATA (NELEMENTS-1) TYPE (NELEMENTS-1) [SIZE (NELEMENTS -1)] Data content

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

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

GET_AARRAY

Data Type Description


STT_AARRAY

Data Type Description

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