VIA - Volumetric Image Analysis
viadata.h
1 
2 #include <viaio/VImage.h>
3 #include <viaio/VGraph.h>
4 #include <viaio/Volumes.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
21 typedef struct SNodeStruct {
22  VNodeBaseRec base;
23  VShort type;
24  VShort col;
25  VShort row;
26  VShort band;
27  VShort label;
28 } SNodeRec, *SNode;
29 
30 
31 
43 typedef struct FNodeStruct {
44  VNodeBaseRec base;
45  VFloat type;
46  VFloat x;
47  VFloat y;
48  VFloat z;
49  VFloat label;
50 } FNodeRec, *FNode;
51 
52 
63 typedef struct {
64  short b;
65  short r;
66  short c;
67 } Voxel, *VoxelList;
68 
69 
70 
80 typedef struct {
81  short r;
82  short c;
83 } Pixel, *PixelList;
84 
85 
97 typedef struct {
98  short b;
99  short r;
100  short c;
101  float val;
102 } VPoint;
103 
104 
115 typedef struct pointStruct{
116  float x;
117  float y;
118  float z;
119 } XPoint;
120 
121 
122 
123 /*
124 ** access to a pixel
125 */
126 #define VPixelIndex(image, i) \
127  ((VPointer) ((char *) (VImageData(image) + (i) * VPixelSize (image))))
128 
129 /*
130 ** fast implementation of rounding
131 */
132 #define VRintPos(x) ((int)((x) + 0.5))
133 #define VRintNeg(x) ((int)((x) - 0.5))
134 #define VRint(x) ((x) >= 0 ? VRintPos(x) : VRintNeg(x))
135 
136 #define VFloor(x) ((x) >= 0 ? (int)((x+0.000001)) : (int)((x) - 0.999999))
137 
138 #define VCeilPos(x) (VRint((x)) == (x) ? (x) : (int)(x+0.99999))
139 #define VCeilNeg(x) (VRint((x)) == (x) ? (x) : (int)(x+0.00001))
140 #define VCeil(x) ((x) >= 0 ? VCeilPos(x) : VCeilNeg(x))
141 
142 
143 /*
144 ** some other stuff
145 */
146 #define VSqr(x) ((x) * (x))
147 #define VAbs(x) ((x) > 0 > ? (x) : -(x))
148 
149 
150 #ifdef __cplusplus
151 } /* extern "C" */
152 #endif /* __cplusplus */
153