00001
00002 #include <viaio/VImage.h>
00003 #include <viaio/VGraph.h>
00004 #include <viaio/Volumes.h>
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00021 typedef struct SNodeStruct {
00022 VNodeBaseRec base;
00023 VShort type;
00024 VShort col;
00025 VShort row;
00026 VShort band;
00027 VShort label;
00028 } SNodeRec, *SNode;
00029
00030
00031
00043 typedef struct FNodeStruct {
00044 VNodeBaseRec base;
00045 VFloat type;
00046 VFloat x;
00047 VFloat y;
00048 VFloat z;
00049 VFloat label;
00050 } FNodeRec, *FNode;
00051
00052
00063 typedef struct {
00064 short b;
00065 short r;
00066 short c;
00067 } Voxel, *VoxelList;
00068
00069
00070
00080 typedef struct {
00081 short r;
00082 short c;
00083 } Pixel, *PixelList;
00084
00085
00097 typedef struct {
00098 short b;
00099 short r;
00100 short c;
00101 float val;
00102 } VPoint;
00103
00104
00115 typedef struct pointStruct{
00116 float x;
00117 float y;
00118 float z;
00119 } XPoint;
00120
00121
00122
00123
00124
00125
00126 #define VPixelIndex(image, i) \
00127 ((VPointer) ((char *) (VImageData(image) + (i) * VPixelSize (image))))
00128
00129
00130
00131
00132 #define VRintPos(x) ((int)((x) + 0.5))
00133 #define VRintNeg(x) ((int)((x) - 0.5))
00134 #define VRint(x) ((x) >= 0 ? VRintPos(x) : VRintNeg(x))
00135
00136 #define VFloor(x) ((x) >= 0 ? (int)((x+0.000001)) : (int)((x) - 0.999999))
00137
00138 #define VCeilPos(x) (VRint((x)) == (x) ? (x) : (int)(x+0.99999))
00139 #define VCeilNeg(x) (VRint((x)) == (x) ? (x) : (int)(x+0.00001))
00140 #define VCeil(x) ((x) >= 0 ? VCeilPos(x) : VCeilNeg(x))
00141
00142
00143
00144
00145
00146 #define VSqr(x) ((x) * (x))
00147 #define VAbs(x) ((x) > 0 > ? (x) : -(x))
00148
00149
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153