Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_imgmeta.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: OpenIGTLink Library
4  Module: $RCSfile$
5  Language: C
6  Date: $Date: 2009-11-17 22:53:00 -0500 (Tue, 17 Nov 2009) $
7  Version: $Revision: 5366 $
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_IMGMETA_H
18 #define __IGTL_IMGMETA_H
19 
20 #include "igtl_win32header.h"
21 #include "igtl_util.h"
22 #include "igtl_types.h"
23 #include "igtl_image.h"
24 
25 #define IGTL_IMGMETA_ELEMENT_SIZE 260
26 
27 /* Scalar type */
28 /* Use the same numbers as IMAGE */
29 /*
30 #define IGTL_IMGMETA_STYPE_TYPE_INT8 2
31 #define IGTL_IMGMETA_STYPE_TYPE_UINT8 3
32 #define IGTL_IMGMETA_STYPE_TYPE_INT16 4
33 #define IGTL_IMGMETA_STYPE_TYPE_UINT16 5
34 #define IGTL_IMGMETA_STYPE_TYPE_INT32 6
35 #define IGTL_IMGMETA_STYPE_TYPE_UINT32 7
36 #define IGTL_IMGMETA_STYPE_TYPE_FLOAT32 10
37 #define IGTL_IMGMETA_STYPE_TYPE_FLOAT64 11
38 */
39 
40 #define IGTL_IMGMETA_LEN_NAME 64
41 #define IGTL_IMGMETA_LEN_DEVICE_NAME 20
42 #define IGTL_IMGMETA_LEN_MODALITY 32
43 #define IGTL_IMGMETA_LEN_PATIENT_NAME 64
44 #define IGTL_IMGMETA_LEN_PATIENT_ID 64
45 
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #pragma pack(1) /* For 1-byte boundary in memroy */
52 
53 /*
54  * Image meta data OpenIGTLinik protocol
55  *
56  * IMAGEMETA is a message type to transfer a list of images available in a server.
57  * A IMGMETA message may contain information of multiple images.
58  * The client determins the number of image meta by the size of the body included
59  * in the message header (see igtl_imgmeta_getdata_n() macro).
60  */
61 
62 typedef struct {
63  char name[IGTL_IMGMETA_LEN_NAME]; /* name / description */
64  char device_name[IGTL_IMGMETA_LEN_DEVICE_NAME]; /* device name to query the IMAGE and COLORT */
65  char modality[IGTL_IMGMETA_LEN_MODALITY]; /* modality name */
66  char patient_name[IGTL_IMGMETA_LEN_PATIENT_NAME]; /* patient name */
67  char patient_id[IGTL_IMGMETA_LEN_PATIENT_ID]; /* patient ID (MRN etc.) */
68  igtl_uint64 timestamp; /* scan time */
69  igtl_uint16 size[3]; /* entire image volume size */
70  igtl_uint8 scalar_type; /* scalar type. see scalar_type in IMAGE message */
71  igtl_uint8 reserved;
73 
74 #pragma pack()
75 
76 
77 /*
78  * Macros for image meta data size
79  *
80  * igtl_imgmeta_get_data_size(n) calculates the size of body based on the number
81  * of images.The size of body is used in the message header.
82  * igtl_imgmeta_get_data_n(size) calculates the number of images in the body, based on
83  * the body size. This function may be used when a client program parses IMGMETA message.
84  *
85  */
86 
87 #define igtl_imgmeta_get_data_size(n) ((n) * IGTL_IMGMETA_ELEMENT_SIZE)
88 #define igtl_imgmeta_get_data_n(size) ((size) / IGTL_IMGMETA_ELEMENT_SIZE)
89 
90 
91 /*
92  * Byte order conversion for the image meta data
93  *
94  * This function converts endianness of each member variable
95  * in igtl_imgmeta_element from host byte order to network byte order,
96  * or vice versa.
97  */
98 
100 
101 
102 /*
103  * CRC calculation
104  *
105  * This function calculates CRC of image meta data body.
106  *
107  */
108 
109 igtl_uint64 igtl_export igtl_imgmeta_get_crc(igtl_imgmeta_element* metalist, int nitem);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* __IGTL_IMGMETA_H */
116 

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