MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------- 00004 00009 //------------------------------------------------------------------------- 00010 // Prevent multiple including of this file. 00011 #if !defined(__mlRankFilter_H) 00012 #define __mlRankFilter_H 00013 00014 00015 // ML-includes 00016 #ifndef __mlInitSystemKernel_H 00017 #include "mlInitSystemKernel.h" 00018 #endif 00019 #ifndef __mlKernel_H 00020 #include "mlKernel.h" 00021 #endif 00022 #ifndef __mlKernelModule_H 00023 #include "mlKernelModule.h" 00024 #endif 00025 00026 ML_START_NAMESPACE 00027 00028 //-------------------------------------------------- 00035 //-------------------------------------------------- 00036 class MLKERNELEXPORT RankFilter : public KernelModule{ 00037 00038 public: 00039 00040 //-------------------------------------------------------------------------------------------------------- 00092 //-------------------------------------------------------------------------------------------------------- 00093 enum RankFilterTypes { 00094 ID = 0, 00095 RANK_FILTER , 00096 MIN_FILTER , 00097 MEDIAN_FILTER , 00098 MAX_FILTER , 00099 RANK_INDEX , 00100 00101 NUM_RANK_FILTER_TYPES 00102 }; 00103 00104 //------------------------------------------------------------------- 00106 //------------------------------------------------------------------- 00107 static const char* const RankFilterNames[]; 00108 00109 //------------------------------------------------------------------- 00127 //------------------------------------------------------------------- 00128 RankFilter(); 00129 00130 //------------------------------------------------------------------- 00132 00133 //------------------------------------------------------------------- 00135 EnumField *getRankFilterFld() { return _rankFilterFld; }; 00136 00138 IntField *getRankFld() { return _rankFld; } 00140 00141 protected: 00142 00143 //------------------------------------------------------------------------------- 00145 //------------------------------------------------------------------------------- 00146 void calculateOutputImageProperties(int outIndex); 00147 00149 virtual void handleNotification(Field* field); 00150 00153 virtual void activateAttachments(); 00154 00155 00161 CALC_ROW_H(); 00162 00165 template <typename DATATYPE> 00166 void calcRow(MLsoffset *indexTab, 00167 size_t indexTabSize, 00168 MLsoffset srcVoxelOffset, 00169 size_t numVox, 00170 DATATYPE *inCursor, 00171 DATATYPE *outCursor, 00172 const ImageVector &/*rowStart*/); 00173 00174 private: 00175 00177 IntField *_rankFld; 00178 00180 EnumField *_rankFilterFld; 00181 00184 BoolField *_useRankFld; 00185 00190 ML_MODULE_CLASS_HEADER(RankFilter); 00191 }; 00192 00193 ML_END_NAMESPACE 00194 00195 #endif //of __mlRankFilter_H 00196 00197 00198 00199 00200