Main Page
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File List
Namespace Members
Compound Members
File Members
Source
igtlutil
igtl_trajectory.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_TRAJECTORY_H
18
#define __IGTL_TRAJECTORY_H
19
20
#include "
igtl_win32header.h
"
21
#include "
igtl_util.h
"
22
#include "
igtl_types.h
"
23
24
#define IGTL_TRAJECTORY_ELEMENT_SIZE 150
25
#define IGTL_TRAJECTORY_LEN_NAME 64
26
#define IGTL_TRAJECTORY_LEN_GROUP_NAME 32
27
#define IGTL_TRAJECTORY_LEN_OWNER 20
28
29
#define IGTL_TRAJECTORY_TYPE_ENTRY_ONLY 1
30
#define IGTL_TRAJECTORY_TYPE_TARGET_ONLY 2
31
#define IGTL_TRAJECTORY_TYPE_ENTRY_TARGET 3
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
37
#pragma pack(1)
/* For 1-byte boundary in memroy */
38
/*
39
* Status data header for OpenIGTLinik protocol
40
*
41
*/
42
43
typedef
struct
{
44
char
name[
IGTL_TRAJECTORY_LEN_NAME
];
/* Name or description of the trajectory */
45
char
group_name[
IGTL_TRAJECTORY_LEN_GROUP_NAME
];
/* Can be "Trajectory", ... */
46
igtl_int8
type
;
/* Trajectory type (see IGTL_TRAJECTORY_TYPE_* macros) */
47
igtl_int8
reserved
;
48
igtl_uint8 rgba[4];
/* Color in R/G/B/A */
49
igtl_float32 entry_pos[3];
/* Coordinate of the entry point */
50
igtl_float32 target_pos[3];
/* Coordinate of the target point */
51
igtl_float32
radius
;
/* Radius of the trajectory. Can be 0. */
52
char
owner_name[
IGTL_TRAJECTORY_LEN_OWNER
];
/* Device name of the ower image */
53
}
igtl_trajectory_element
;
54
55
#pragma pack()
56
57
58
/*
59
* Macros for trajectory data size
60
*
61
* igtl_trajectory_get_data_size(n) calculates the size of body based on the number
62
* of trajectorys. The size of body is used in the message header.
63
* igtl_trajectory_get_data_n(size) calculates the number of images in the body, based on
64
* the body size. This function may be used when a client program parses a TRAJECTORY message.
65
*
66
*/
67
68
#define igtl_trajectory_get_data_size(n) ((n) * IGTL_TRAJECTORY_ELEMENT_SIZE)
69
#define igtl_trajectory_get_data_n(size) ((size) / IGTL_TRAJECTORY_ELEMENT_SIZE)
70
71
/*
72
* Byte order conversion for an array of trajectory data structure
73
*
74
* This function converts endianness of each element in an array of
75
* igtl_igtl_trajectory_element from host byte order to network byte order,
76
* or vice versa.
77
*/
78
79
void
igtl_export
igtl_trajectory_convert_byte_order
(
igtl_trajectory_element
* trajectorylist,
int
nelem);
80
81
82
/*
83
* CRC calculation
84
*
85
* This function calculates CRC of trajectory message
86
*
87
*/
88
89
igtl_uint64
igtl_export
igtl_trajectory_get_crc
(
igtl_trajectory_element
* trajectorylist,
int
nelem);
90
91
#ifdef __cplusplus
92
}
93
#endif
94
95
#endif
/* __IGTL_POSITION_H */
96
97
98
Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by
1.8.1.2 written by
Dimitri van Heesch
, © 1997-2000