File: ndarray.md

package info (click to toggle)
openigtlink 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,080 kB
  • sloc: cpp: 20,076; ansic: 6,704; sh: 227; perl: 74; makefile: 46
file content (105 lines) | stat: -rwxr-xr-x 2,321 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
layout: page
title: Specification > NDArray
header: Pages
---
{% include JB/setup %}

## Summary

NDARRAY is a data type, which is designed to transfer N-dimensional numerical array.


## Message Types

### NDARRAY

<table border="1" cellpadding="5" cellspacing="0" align="center">

<tbody><tr>
<td style="background:#e0e0e0;"> Data
</td><td style="background:#e0e0e0;"> Type
</td><td style="background:#e0e0e0;"> Description
</td></tr>
<tr>
<td align="left"> TYPE
</td><td align="left"> UINT8
</td><td align="left"> Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64 13:complex float 64*)
</td></tr>
<tr>
<td align="left"> DIM
</td><td align="left"> UINT8
</td><td align="left"> Dimension of array
</td></tr>
<tr>
<td align="left"> SIZE
</td><td align="left"> UINT16[DIM]
</td><td align="left"> Size of array
</td></tr>
<tr>
<td align="left"> DATA
</td><td align="left"> TYPE[SIZE[0]][SIZE[1]]....[[SIZE[DIM-1]]]
</td><td align="left"> Array data. (Must be in network byte order.)
</td></tr>
</tbody></table>

* 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.

### GET_NDARRAY

<table border="1" cellpadding="5" cellspacing="0" align="center">

<tbody><tr>
<td style="background:#e0e0e0;"> Data
</td><td style="background:#e0e0e0;"> Type
</td><td style="background:#e0e0e0;"> Description
</td></tr>
</tbody></table>

### STT_NDARRAY

N/A

### STP_NDARRAY

N/A

### RTS_NDARRAY

N / A


## Notes
### 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|
      +-+-+-+-+-+-+-+-+-+

## Implementations

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

* [igtlNDArrayMessage.h](https://github.com/openigtlink/OpenIGTLink/blob/master/Source/igtlNDArrayMessage.h)
* [igtlNDArrayMessage.cxx](https://github.com/openigtlink/OpenIGTLink/blob/master/Source/igtlNDArrayMessage.cxx)


## Contributors

* Junichi Tokuda
* Yuichiro Hayashi