00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00030 #ifndef IPSEGMENTATION_H
00031 #define IPSEGMENTATION_H
00032
00033 #include <mitkIpPic.h>
00034
00035 #if defined(__cplusplus) || defined(c_plusplus)
00036 extern "C"
00037 {
00038 #endif
00039
00043 #define ipMITKSegmentationTYPE mitkIpUInt1_t
00044 #define ipMITKSegmentationTYPE_ID mitkIpPicUInt
00045 #define ipMITKSegmentationBPE 8
00046 #define tagSEGMENTATION_EMPTY "SEGMENTATION_EMPTY"
00047
00053 extern mitkIpPicDescriptor* ipMITKSegmentationNew (mitkIpPicDescriptor* image);
00054
00059 extern void ipMITKSegmentationFree (mitkIpPicDescriptor* segmentation);
00060
00066 extern void ipMITKSegmentationClear (mitkIpPicDescriptor* segmentation);
00067
00074 extern mitkIpPicDescriptor* ipMITKSegmentationInterpolate (mitkIpPicDescriptor* pic1, mitkIpPicDescriptor* pic2, const mitkIpFloat4_t ratio);
00075
00079 enum LogicalOp {
00080 IPSEGMENTATION_OP ,
00081 IPSEGMENTATION_AND ,
00082 IPSEGMENTATION_OR ,
00083 IPSEGMENTATION_XOR
00084 };
00085
00097 extern void ipMITKSegmentationCombineRegion (mitkIpPicDescriptor* segmentation, const mitkIpInt4_t* const points, const int num, mitkIpPicDescriptor* mask, const int operation, int value);
00098
00104 extern void ipMITKSegmentationUndoEnable (mitkIpPicDescriptor* segmentation, const mitkIpUInt1_t level);
00105
00111 extern void ipMITKSegmentationUndoDisable (mitkIpPicDescriptor* segmentation);
00112
00117 extern mitkIpBool_t ipMITKSegmentationUndoIsEnabled (mitkIpPicDescriptor* segmentation);
00118
00123 extern mitkIpBool_t ipMITKSegmentationUndoAvailable (mitkIpPicDescriptor* segmentation);
00124
00129 extern void ipMITKSegmentationUndoSave (mitkIpPicDescriptor* segmentation);
00130
00135 extern void ipMITKSegmentationUndo (mitkIpPicDescriptor* segmentation);
00136
00137 #if defined(__cplusplus) || defined(c_plusplus)
00138 }
00139 #endif
00140
00152 extern mitkIpPicDescriptor* ipMITKSegmentationGrowRegion4N( mitkIpPicDescriptor *src, int startOfs, bool relativeBounds, float lowerBound, float upperBound, int maxIterations, mitkIpPicDescriptor *segBuffer, mitkIpPicDescriptor *histBuffer=0 );
00153
00160 extern mitkIpPicDescriptor* ipMITKSegmentationGrowRegion4N( mitkIpPicDescriptor *src, int startOfs, bool relativeBounds, float lowerBound, float upperBound, int maxIterations, mitkIpPicDescriptor *segBuffer, int &contourOfs, float &startCol, mitkIpPicDescriptor *histBuffer=0 );
00161
00167 extern int ipMITKSegmentationReplaceRegion4N( mitkIpPicDescriptor *seg, int startOfs, mitkIpInt1_t newValue );
00168
00172 extern float* ipMITKSegmentationGetContour8N( const mitkIpPicDescriptor *seg, int startOfs, int &numPoints, int &sizeBuffer, float *pointBuffer=0 );
00173
00174
00175 typedef struct {
00176 float *traceline;
00177 bool *onGradient;
00178 int numPoints;
00179 int absMin;
00180 bool cutIt;
00181 float cutCoords[4];
00182 float *deleteCurve;
00183 int deleteSize;
00184 } tCutResult;
00185
00192 extern tCutResult ipMITKSegmentationGetCutPoints( mitkIpPicDescriptor *seg, mitkIpPicDescriptor *history, int ofs );
00193
00199 extern mitkIpPicDescriptor* ipMITKSegmentationCreateGrowerHistory( mitkIpPicDescriptor *seg, int startOfs, mitkIpPicDescriptor *histBuffer );
00200
00207 extern void ipMITKSegmentationSplitContour( float *contour, int sizeContour, float *cutCoords, float *part1, int &size1, float *part2, int &size2 );
00208
00212 extern bool ipMITKSegmentationIsInsideContour( float *contour, int sizeContour, float x, float y );
00213
00214 #endif