Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_image.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 
15 #ifndef __IGTL_IMAGE_H
16 #define __IGTL_IMAGE_H
17 
18 #include "igtl_win32header.h"
19 #include "igtl_util.h"
20 #include "igtl_types.h"
21 #include "igtl_win32header.h"
22 
23 #define IGTL_IMAGE_HEADER_VERSION 1
24 #define IGTL_IMAGE_HEADER_SIZE 72
25 
26 /* Data type */
27 #define IGTL_IMAGE_DTYPE_SCALAR 1
28 #define IGTL_IMAGE_DTYPE_VECTOR 3
29 
30 /* Scalar type */
31 #define IGTL_IMAGE_STYPE_TYPE_INT8 2
32 #define IGTL_IMAGE_STYPE_TYPE_UINT8 3
33 #define IGTL_IMAGE_STYPE_TYPE_INT16 4
34 #define IGTL_IMAGE_STYPE_TYPE_UINT16 5
35 #define IGTL_IMAGE_STYPE_TYPE_INT32 6
36 #define IGTL_IMAGE_STYPE_TYPE_UINT32 7
37 #define IGTL_IMAGE_STYPE_TYPE_FLOAT32 10
38 #define IGTL_IMAGE_STYPE_TYPE_FLOAT64 11
39 
40 /* Endian */
41 #define IGTL_IMAGE_ENDIAN_BIG 1
42 #define IGTL_IMAGE_ENDIAN_LITTLE 2
43 
44 /* Image coordinate system */
45 #define IGTL_IMAGE_COORD_RAS 1
46 #define IGTL_IMAGE_COORD_LPS 2
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #pragma pack(1) /* For 1-byte boundary in memroy */
53 
63 typedef struct {
64  igtl_uint16 version; /* data format version number(1) */
65  igtl_uint8 num_components; /* number of components per element*/
66  igtl_uint8 scalar_type; /* scalar type */
67  /*2:int8 3:uint8 4:int16 5:uint16 6:int32 7:uint32 10:float32 11:float64) */
68  igtl_uint8 endian; /* endian type of image data */
69  /* (1:big, 2:little) */
70  igtl_uint8 coord; /* coordinate system (1:RAS 2:LPS) */
71  igtl_uint16 size[3]; /* entire image volume size */
72  igtl_float32 matrix[12]; /* orientation / origin of image */
73  /* - matrix[0-2]: norm_i * pix_i */
74  /* - matrix[3-5]: norm_j * pix_j */
75  /* - matrix[6-8]: norm_k * pix_k */
76  /* - matrix[9-11]:origin */
77  /* where norm_* are normal vectors */
78  /* along each index, and pix_* are */
79  /* pixel size in each direction */
81 
82  igtl_uint16 subvol_offset[3]; /* sub volume offset */
83  igtl_uint16 subvol_size[3]; /* sub volume size */
85 
86 #pragma pack()
87 
88 
91 
92 
94 void igtl_export igtl_image_set_matrix(float spacing[3], float origin[3],
95  float norm_i[3], float norm_j[3], float norm_k[3],
96  igtl_image_header * header);
97 
98 void igtl_export igtl_image_get_matrix(float spacing[3], float origin[3],
99  float norm_i[3], float norm_j[3], float norm_k[3],
100  igtl_image_header * header);
101 
103 void igtl_export igtl_image_set_matrix_4x4(float _matrix[4][4],igtl_image_header * header);
104 
106 void igtl_export igtl_image_get_matrix_4x4(float _matrix[4][4],igtl_image_header * header);
107 
111 
113 igtl_uint64 igtl_export igtl_image_get_crc(igtl_image_header * header, void* image);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif /* __IGTL_IMAGE_H */
igtl_uint8 scalar_type
Definition: igtl_image.h:66
void igtl_export igtl_image_get_matrix(float spacing[3], float origin[3], float norm_i[3], float norm_j[3], float norm_k[3], igtl_image_header *header)
igtl_uint16 version
Definition: igtl_image.h:64
#define igtl_export
igtl_uint8 coord
Definition: igtl_image.h:70
igtl_uint8 endian
Definition: igtl_image.h:68
igtl_uint8 num_components
Definition: igtl_image.h:65
void igtl_export igtl_image_set_matrix_4x4(float _matrix[4][4], igtl_image_header *header)
void igtl_export igtl_image_convert_byte_order(igtl_image_header *header)
void igtl_export igtl_image_get_matrix_4x4(float _matrix[4][4], igtl_image_header *header)
igtl_uint64 igtl_export igtl_image_get_data_size(igtl_image_header *header)
igtl_uint64 igtl_export igtl_image_get_crc(igtl_image_header *header, void *image)
void igtl_export igtl_image_set_matrix(float spacing[3], float origin[3], float norm_i[3], float norm_j[3], float norm_k[3], igtl_image_header *header)

Generated at Tue Nov 3 2015 19:17:46 for OpenIGTLink by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2012