Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef IPSEGMENTATIONP_H
00018 #define IPSEGMENTATIONP_H
00019
00020 #include <mitkIpPic.h>
00021 #include "ipSegmentationError.h"
00022
00023 #ifndef IPSEGMENTATION_H
00024
00025 #if defined(__cplusplus) || defined(c_plusplus)
00026 extern "C"
00027 {
00028 #endif
00029
00030 #define ipMITKSegmentationTYPE mitkIpUInt1_t
00031 #define ipMITKSegmentationTYPE_ID mitkIpPicUInt
00032 #define ipMITKSegmentationBPE 8
00033 #define tagSEGMENTATION_EMPTY "SEGMENTATION_EMPTY"
00034
00035 enum LogicalOp {
00036 IPSEGMENTATION_OP ,
00037 IPSEGMENTATION_AND ,
00038 IPSEGMENTATION_OR ,
00039 IPSEGMENTATION_XOR
00040 };
00041
00042 extern void ipMITKSegmentationUndoSave (mitkIpPicDescriptor* segmentation);
00043 extern mitkIpBool_t ipMITKSegmentationUndoIsEnabled (mitkIpPicDescriptor* segmentation);
00044
00045 #if defined(__cplusplus) || defined(c_plusplus)
00046 }
00047 #endif
00048
00049 #endif
00050
00051 #define AND(TYPE, PIC, VALUE, X, Y) \
00052 { \
00053 TYPE* data = (TYPE*) (PIC)->data; \
00054 mitkIpUInt4_t width = (PIC)->n[0]; \
00055 int temp = (int) data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X]; \
00056 temp &= (int) VALUE; \
00057 data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X] = temp; \
00058 } \
00059
00060 #define OR(TYPE, PIC, VALUE, X, Y) \
00061 { \
00062 TYPE* data = (TYPE*) (PIC)->data; \
00063 mitkIpUInt4_t width = (PIC)->n[0]; \
00064 int temp = (int) data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X]; \
00065 temp |= (int) VALUE; \
00066 data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X] = temp; \
00067 } \
00068
00069 #define XOR(TYPE, PIC, VALUE, X, Y) \
00070 { \
00071 TYPE* data = (TYPE*) (PIC)->data; \
00072 mitkIpUInt4_t width = (PIC)->n[0]; \
00073 int temp = (int) data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X]; \
00074 temp ^= (int) VALUE; \
00075 data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X] = temp; \
00076 } \
00077
00078 #define OP(TYPE, PIC, VALUE, X, Y) \
00079 { \
00080 TYPE* data = (TYPE*) (PIC)->data; \
00081 mitkIpUInt4_t width = (PIC)->n[0]; \
00082 data [width * (mitkIpUInt4_t) Y + (mitkIpUInt4_t) X] = VALUE; \
00083 } \
00084
00085 #define MASK(TYPE, PIC, MSK, VALUE, X, Y, CMD) \
00086 { \
00087 if (!(MSK) || (((ipMITKSegmentationTYPE *)(MSK)->data)[(PIC)->n[0] * (mitkIpUInt4_t) (Y) + (mitkIpUInt4_t) (X)] > 0.0)) \
00088 CMD(TYPE, PIC, VALUE, X, Y) \
00089 }
00090
00091 #endif