Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_point.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: OpenIGTLink Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink2_beta/Source/igtlutil/igtl_position.h $
5  Language: C
6  Date: $Date: 2009-11-13 11:37:44 -0500 (Fri, 13 Nov 2009) $
7  Version: $Revision: 5335 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __IGTL_POINT_H
18 #define __IGTL_POINT_H
19 
20 #include "igtl_win32header.h"
21 #include "igtl_util.h"
22 #include "igtl_types.h"
23 
24 #define IGTL_POINT_ELEMENT_SIZE 136
25 
26 #define IGTL_POINT_LEN_NAME 64
27 #define IGTL_POINT_LEN_GROUP_NAME 32
28 #define IGTL_POINT_LEN_OWNER 20
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #pragma pack(1) /* For 1-byte boundary in memroy */
35 /*
36  * Status data header for OpenIGTLinik protocol
37  *
38  */
39 
40 typedef struct {
41  char name[IGTL_POINT_LEN_NAME]; /* Name or description of the point */
42  char group_name[IGTL_POINT_LEN_GROUP_NAME]; /* Can be "Labeled Point", "Landmark", Fiducial", ... */
43  igtl_uint8 rgba[4]; /* Color in R/G/B/A */
44  igtl_float32 position[3]; /* Coordinate of the point */
45  igtl_float32 radius; /* Radius of the point. Can be 0. */
46  char owner[IGTL_POINT_LEN_OWNER];/* Device name of the ower image */
48 
49 #pragma pack()
50 
51 
52 /*
53  * Macros for point data size
54  *
55  * igtl_point_get_data_size(n) calculates the size of body based on the number
56  * of points. The size of body is used in the message header.
57  * igtl_point_get_data_n(size) calculates the number of images in the body, based on
58  * the body size. This function may be used when a client program parses a POINT message.
59  *
60  */
61 
62 #define igtl_point_get_data_size(n) ((n) * IGTL_POINT_ELEMENT_SIZE)
63 #define igtl_point_get_data_n(size) ((size) / IGTL_POINT_ELEMENT_SIZE)
64 
65 /*
66  * Byte order conversion for an array of point data structure
67  *
68  * This function converts endianness of each element in an array of
69  * igtl_igtl_point_element from host byte order to network byte order,
70  * or vice versa.
71  */
72 
74 
75 
76 /*
77  * CRC calculation
78  *
79  * This function calculates CRC of point message
80  *
81  */
82 
83 igtl_uint64 igtl_export igtl_point_get_crc(igtl_point_element* pointlist, int nelem);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* __IGTL_POINT_H */
90 
91 
92 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000