Fraxinus  2023.01.05-dev+develop.0da12
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_ */
void igtl_export igtl_sonix_status_convert_byte_order(igtl_sonix_status_message *message)
igtl_uint64 igtl_export igtl_sonix_status_get_crc(igtl_sonix_status_message *message)