NorMIT-nav  22.09
An IGT application
igtl_sonix_status.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef IGTL_SONIX_STATUS_H_
12 #define IGTL_SONIX_STATUS_H_
13 
14 #include "igtl_win32header.h"
15 #include "igtl_types.h"
16 #include "igtl_win32header.h"
17 
18 #define IGTL_SONIX_STATUS_HEADER_SIZE 70 // 8*3 + 4*3 + 4*8 + 2
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #pragma pack(1) /* For 1-byte boundary in memroy */
25 
26 typedef struct {
27  igtl_float64 spacingX;
28  igtl_float64 spacingY;
29  igtl_float64 spacingZ;
30  igtl_float32 oi;//Origin
31  igtl_float32 oj;//Origin
32  igtl_float32 ok;//Origin
33  igtl_int32 ulx;
34  igtl_int32 uly;
35  igtl_int32 urx;
36  igtl_int32 ury;
37  igtl_int32 brx;
38  igtl_int32 bry;
39  igtl_int32 blx;
40  igtl_int32 bly;
41  igtl_uint16 status;// 0 = not changed, 1 = changed
43 
44 #pragma pack()
45 
46 /*
47  * String data size
48  *
49  * This function calculates size of the pixel array, which will be
50  * transferred with the specified header.
51  */
52 
53 //igtl_uint32 igtl_export igtl_sonix_status_get_length(igtl_sonix_status_header * header);
54 
55 /*
56  * Byte order conversion
57  *
58  * This function converts endianness from host byte order to network byte order,
59  * or vice versa.
60  * NOTE: It is developer's responsibility to have the string body with BOM
61  * (byte order mark) or in big endian ordrer.
62  */
63 
65 
66 /*
67  * CRC calculation
68  *
69  * This function calculates CRC of image data body including header
70  * and array of pixel data.
71  *
72  */
73 
74 igtl_uint64 igtl_export igtl_sonix_status_get_crc(igtl_sonix_status_message * message);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* IGTL_SONIX_STATUS_H_ */
igtl_sonix_status_convert_byte_order
void igtl_export igtl_sonix_status_convert_byte_order(igtl_sonix_status_message *message)
Definition: igtl_sonix_status.c:11
igtl_sonix_status_message
Definition: igtl_sonix_status.h:26
igtl_sonix_status_message::bry
igtl_int32 bry
Definition: igtl_sonix_status.h:38
igtl_sonix_status_message::blx
igtl_int32 blx
Definition: igtl_sonix_status.h:39
igtl_sonix_status_get_crc
igtl_uint64 igtl_export igtl_sonix_status_get_crc(igtl_sonix_status_message *message)
Definition: igtl_sonix_status.c:31
igtl_sonix_status_message::brx
igtl_int32 brx
Definition: igtl_sonix_status.h:37
igtl_sonix_status_message::oj
igtl_float32 oj
Definition: igtl_sonix_status.h:31
igtl_sonix_status_message::spacingZ
igtl_float64 spacingZ
Definition: igtl_sonix_status.h:29
igtl_sonix_status_message::bly
igtl_int32 bly
Definition: igtl_sonix_status.h:40
igtl_sonix_status_message::spacingX
igtl_float64 spacingX
Definition: igtl_sonix_status.h:27
igtl_sonix_status_message::uly
igtl_int32 uly
Definition: igtl_sonix_status.h:34
igtl_sonix_status_message::oi
igtl_float32 oi
Definition: igtl_sonix_status.h:30
igtl_sonix_status_message::spacingY
igtl_float64 spacingY
Definition: igtl_sonix_status.h:28
igtl_sonix_status_message::urx
igtl_int32 urx
Definition: igtl_sonix_status.h:35
igtl_sonix_status_message::ulx
igtl_int32 ulx
Definition: igtl_sonix_status.h:33
igtl_sonix_status_message::status
igtl_uint16 status
Definition: igtl_sonix_status.h:41
igtl_sonix_status_message::ok
igtl_float32 ok
Definition: igtl_sonix_status.h:32
igtl_sonix_status_message::ury
igtl_int32 ury
Definition: igtl_sonix_status.h:36