Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #ifndef IGTL_SONIX_STATUS_H_
33 #define IGTL_SONIX_STATUS_H_
34 
35 #include "igtl_win32header.h"
36 #include "igtl_types.h"
37 #include "igtl_win32header.h"
38 
39 #define IGTL_SONIX_STATUS_HEADER_SIZE 70 // 8*3 + 4*3 + 4*8 + 2
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #pragma pack(1) /* For 1-byte boundary in memroy */
46 
47 typedef struct {
48  igtl_float64 spacingX;
49  igtl_float64 spacingY;
50  igtl_float64 spacingZ;
51  igtl_float32 oi;//Origin
52  igtl_float32 oj;//Origin
53  igtl_float32 ok;//Origin
54  igtl_int32 ulx;
55  igtl_int32 uly;
56  igtl_int32 urx;
57  igtl_int32 ury;
58  igtl_int32 brx;
59  igtl_int32 bry;
60  igtl_int32 blx;
61  igtl_int32 bly;
62  igtl_uint16 status;// 0 = not changed, 1 = changed
64 
65 #pragma pack()
66 
67 /*
68  * String data size
69  *
70  * This function calculates size of the pixel array, which will be
71  * transferred with the specified header.
72  */
73 
74 //igtl_uint32 igtl_export igtl_sonix_status_get_length(igtl_sonix_status_header * header);
75 
76 /*
77  * Byte order conversion
78  *
79  * This function converts endianness from host byte order to network byte order,
80  * or vice versa.
81  * NOTE: It is developer's responsibility to have the string body with BOM
82  * (byte order mark) or in big endian ordrer.
83  */
84 
86 
87 /*
88  * CRC calculation
89  *
90  * This function calculates CRC of image data body including header
91  * and array of pixel data.
92  *
93  */
94 
95 igtl_uint64 igtl_export igtl_sonix_status_get_crc(igtl_sonix_status_message * message);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #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)