Difference between revisions of "OpenIGTLink/ProtocolV2/Type/NDArray"
From NAMIC Wiki
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[OpenIGTLink/ProtocolV2/ | + | [[OpenIGTLink/ProtocolV2/Index | << Version 2 Index Page]] |
=Summary= | =Summary= | ||
Line 16: | Line 16: | ||
| align="left" | TYPE | | align="left" | TYPE | ||
| align="left" | UINT8 | | align="left" | UINT8 | ||
− | | align="left" | | + | | align="left" | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64 13:complex float 64*) |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| align="left" | DIM | | align="left" | DIM | ||
Line 31: | Line 27: | ||
|- | |- | ||
| align="left" | DATA | | align="left" | DATA | ||
− | | align="left" | | + | | align="left" | TYPE[SIZE[0]][SIZE[1]]....[[SIZE[DIM-1]]] |
− | + | | align="left" | Array data. (Must be in network byte order.) | |
− | TYPE[SIZE[0]][SIZE[1 | ||
− | | align="left" | Array data. ( | ||
|- | |- | ||
|} | |} | ||
+ | <font color=red>2/16/2011: Complex number support is added.</font> | ||
+ | |||
+ | *Complex is a 128-bit variable consisting of a real part in the first 64-bit and an imaginal part in the last 64-bit. | ||
+ | |||
+ | ===Memory layout of DATA field=== | ||
+ | Like multi-dimensional array in C/C++, DATA field is laid out in sequentially in a byte stream. For example, if the value of DATA is defined by: | ||
+ | |||
+ | char data[3][3] = {{1, 2, 3}, | ||
+ | {4, 5, 6}, | ||
+ | {7, 8, 9} | ||
+ | }; | ||
+ | |||
+ | the layout in the byte stream can be visualized as follows: | ||
+ | +-+-+-+-+-+-+-+-+-+ | ||
+ | |1|2|3|4|5|6|7|8|9| | ||
+ | +-+-+-+-+-+-+-+-+-+ | ||
==GET_NDARRAY== | ==GET_NDARRAY== | ||
Line 50: | Line 60: | ||
==STT_NDARRAY== | ==STT_NDARRAY== | ||
− | + | N/A | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==STP_NDARRAY== | ==STP_NDARRAY== | ||
− | + | N/A | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==RTS_NDARRAY== | ==RTS_NDARRAY== | ||
+ | N / A | ||
+ | |||
=Implementations= | =Implementations= | ||
+ | |||
The NDARRAY message type is implemented in the following source code. | The NDARRAY message type is implemented in the following source code. | ||
<!-- | <!-- |
Latest revision as of 04:44, 30 November 2011
Home < OpenIGTLink < ProtocolV2 < Type < NDArrayContents
Summary
NDARRAY is a data type, which is designed to transfer N-dimensional numerical array.
Message Types
NDARRAY
Data | Type | Description |
TYPE | UINT8 | Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64 13:complex float 64*) |
DIM | UINT8 | Dimension of array |
SIZE | UINT16[DIM] | Size of array |
DATA | TYPE[SIZE[0]][SIZE[1]]....[[SIZE[DIM-1]]] | Array data. (Must be in network byte order.) |
2/16/2011: Complex number support is added.
- Complex is a 128-bit variable consisting of a real part in the first 64-bit and an imaginal part in the last 64-bit.
Memory layout of DATA field
Like multi-dimensional array in C/C++, DATA field is laid out in sequentially in a byte stream. For example, if the value of DATA is defined by:
char data[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
the layout in the byte stream can be visualized as follows:
+-+-+-+-+-+-+-+-+-+ |1|2|3|4|5|6|7|8|9| +-+-+-+-+-+-+-+-+-+
GET_NDARRAY
Data | Type | Description |
STT_NDARRAY
N/A
STP_NDARRAY
N/A
RTS_NDARRAY
N / A
Implementations
The NDARRAY message type is implemented in the following source code.
Contributors
Junichi Tokuda, Yuichiro Hayashi