MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLKernel/mlCloseGapFilter.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //-------------------------------------------------------------------------
00005 
00010 //-------------------------------------------------------------------------
00011 // Prevent multiple including of this file.
00012 #if !defined (__mlCloseGapFilter_H)
00013 #define __mlCloseGapFilter_H
00014 
00015 // ML-includes
00016 #ifndef __mlInitSystemKernel_H
00017 #include "mlInitSystemKernel.h"
00018 #endif
00019 #ifndef __mlKernelModule_H
00020 #include "mlKernelModule.h"
00021 #endif
00022 
00023 ML_START_NAMESPACE
00024 
00025   //--------------------------------------------------------------------
00034   //--------------------------------------------------------------------
00035   class MLKERNELEXPORT CloseGapFilter : public KernelModule {
00036 
00037   public:
00038 
00039     //--------------------------------------------------------------------------------------------------------
00130     //--------------------------------------------------------------------------------------------------------
00131     enum CloseGapFilters {
00132       ID                  = 0,
00133       CLOSEGAP            ,
00134       MAJORITY            ,
00135       PAIR_MAJORITY       ,
00136       DILATION            ,
00137       EROSION             ,
00138       CONTOUR_POINT_FILTER,
00139 
00140       NUM_CLOSEGAP_FILTERS
00141     };
00142 
00144     static const char* const CloseGapFilterNames[];
00145 
00146     //--------------------------------------------------------------------
00162     //--------------------------------------------------------------------
00163     enum CloseGapKernels {
00164       CLOSEGAP_KERNEL     = 0,
00165       FULL_KERNEL         ,
00166       STAR_KERNEL         ,
00167       BOX_KERNEL          ,
00168 
00169       NUM_CLOSEGAP_KERNELS
00170     };
00171 
00173     static const char* const CloseGapKernelNames[];
00174 
00175 
00176     //-------------------------------------------------------------------
00195     //-------------------------------------------------------------------
00196     CloseGapFilter();
00197 
00198     //-------------------------------------------------------------------
00200 
00201     //-------------------------------------------------------------------
00202     inline EnumField    *getCloseGapFilterFld      () const { return _closeGapFilterFld      ; };
00203     inline FloatField   *getSensitivityFld         () const { return _sensitivityFld         ; };
00204     inline EnumField    *getSelectInternalKernelFld() const { return _selectInternalKernelFld; };
00206 
00207   protected:
00209     virtual void handleNotification(Field* field);
00210 
00213     virtual void activateAttachments();
00214 
00220     CALC_ROW_H();
00221 
00224     template <typename DATATYPE>
00225       void calcRow(MLsoffset    *indexTab,
00226                    size_t       indexTabSize,
00227                    MLsoffset    srcVoxelOffset,
00228                    size_t       numVox,
00229                    DATATYPE     *inCursor,
00230                    DATATYPE     *outCursor,
00231                    const ImageVector &/*rowStart*/);
00232 
00233     // After checking all inherited GUI elements we use this kernel update method
00234     // to overwrite kernel settings in that case that a special kernel has been
00235     // selected by the \c _selectInternalKernelFld.
00236     virtual void _userKernelPostUpdate();
00237 
00238   private:
00239 
00240     //-------------------------------------------------------------------
00242 
00243     //-------------------------------------------------------------------
00245     EnumField    *_closeGapFilterFld;
00246 
00248     FloatField   *_sensitivityFld;
00249 
00251     EnumField    *_selectInternalKernelFld;
00253 
00256     std::vector<MLint> _orderedIndices;
00257 
00262     ML_MODULE_CLASS_HEADER(CloseGapFilter);
00263  };
00264 
00265 ML_END_NAMESPACE
00266 
00267 #endif //of __mlCloseGapFilter_H
00268 
00269 
00270