MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLKernel/mlCompassFilter.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //-------------------------------------------------------------------------
00004 
00009 //-------------------------------------------------------------------------
00010 // Prevent multiple including of this file.
00011 #if !defined (__mlCompassFilter_H)
00012 #define __mlCompassFilter_H
00013 
00014 // ML-includes
00015 #ifndef __mlInitSystemKernel_H
00016 #include "mlInitSystemKernel.h"
00017 #endif
00018 #ifndef __mlKernelModule_H
00019 #include "mlKernelModule.h"
00020 #endif
00021 
00022 ML_START_NAMESPACE
00023 
00024   //--------------------------------------------------
00033   //--------------------------------------------------
00034   class MLKERNELEXPORT CompassFilter : public KernelModule{
00035 
00036   public:
00037     //-------------------------------------------------------------------
00040     //-------------------------------------------------------------------
00041     enum CompassFilterSelect{PREWITT                   = 0,
00042                              KIRSCH                    ,
00043                              ROBINSON_3_LEVEL          ,
00044                              ROBINSON_5_LEVEL          ,
00045 
00046                              NUM_COMPASS_FILTER_SELECTS};
00047 
00048     //-------------------------------------------------------------------
00051     //-------------------------------------------------------------------
00052     static const char* const CompassFilterSelectNames[];
00053 
00054 
00055 
00056     //-------------------------------------------------------------------
00058     //-------------------------------------------------------------------
00059     enum DirectionSelect{EAST                 = 0,
00060                          NORTH_EAST           ,
00061                          NORTH                ,
00062                          NORTH_WEST           ,
00063 
00064                          WEST                 ,
00065                          SOUTH_WEST           ,
00066                          SOUTH                ,
00067                          SOUTH_EAST           ,
00068 
00069                          ALL_DIRECTIONS       ,
00070 
00071                          NUM_DIRECTION_SELECTS};
00072 
00073     //-------------------------------------------------------------------
00076     //-------------------------------------------------------------------
00077     static const char* const DirectionNames[];
00078 
00079 
00080     //-------------------------------------------------------------------
00088     //-------------------------------------------------------------------
00089     CompassFilter();
00090 
00091     //-------------------------------------------------------------------
00093 
00094     //-------------------------------------------------------------------
00095     inline EnumField*   getCompassFilterSelectFld() const { return _compassFilterSelectFld; }
00096     inline EnumField*   getDirectionFld          () const { return _directionFld          ; }
00097     inline IntField *   getDirectionIntFld       () const { return _directionIntFld       ; }
00099 
00100 
00101   private:
00102 
00104     virtual void handleNotification(Field* field);
00105 
00108     virtual void activateAttachments();
00109 
00111     virtual void calculateOutputImageProperties(int outIndex);
00112 
00118     CALC_ROW_H();
00119 
00122     template <typename DATATYPE>                                            
00123       void calcRow(MLsoffset    *indexTab,       
00124                    size_t       indexTabSize,                 
00125                    MLsoffset    /*srcVoxelOffset*/,                     
00126                    size_t       numVox,                 
00127                    DATATYPE     *inCursor,                             
00128                    DATATYPE     *outCursor,
00129                    const ImageVector &/*rowStart*/);                           
00130 
00131 
00132     //-----------------------------------members--------------------------------------
00133   private:
00134 
00136     EnumField*   _compassFilterSelectFld;
00137 
00139     EnumField*   _directionFld;
00140 
00142     IntField*    _directionIntFld;
00143 
00148     ML_MODULE_CLASS_HEADER(CompassFilter);
00149  };
00150 
00151 ML_END_NAMESPACE
00152 
00153 #endif //of __mlCompassFilter_H
00154