MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLKernel/mlRobertsFilter.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //-------------------------------------------------------------------------
00004 
00009 //-------------------------------------------------------------------------
00010 // Prevent multiple including of this file.
00011 #if !defined(__mlRobertsFilter_H)
00012 #define __mlRobertsFilter_H
00013 
00014 // ML-includes
00015 #ifndef __mlInitSystemKernel_H
00016 #include "mlInitSystemKernel.h"
00017 #endif
00018 #ifndef __mlKernel_H
00019 #include "mlKernel.h"
00020 #endif
00021 #ifndef __mlKernelModule_H
00022 #include "mlKernelModule.h"
00023 #endif
00024 
00025 ML_START_NAMESPACE
00026 
00027   //--------------------------------------------------
00034   //--------------------------------------------------
00035   class MLKERNELEXPORT RobertsFilter : public KernelModule{
00036 
00037   public: 
00038 
00039     //-------------------------------------------------------------------
00041     //-------------------------------------------------------------------
00042     enum RCrossOperators {
00043       RCROSS_ONE_DIRECTION_X = 0,
00044       RCROSS_ONE_DIRECTION_Y    ,
00045       RCROSS_NORMAL             ,
00046       RCROSS_ABS                ,
00047       RCROSS_SQUARE             ,
00048       RCROSS_6_ABS              ,
00049       RCROSS_6_SQUARE           ,
00050 
00051       NUM_RCROSS_OPERATORS
00052     };
00053 
00054     //-------------------------------------------------------------------------------------------
00056     //-------------------------------------------------------------------------------------------
00057     static const char* const RCrossOperatorNames[];
00058 
00059 
00060     //-------------------------------------------------------------------
00073     //-------------------------------------------------------------------
00074     RobertsFilter();
00075 
00077     EnumField *getWhichRobertsOperatorFld() { return _whichRobertsOperatorFld; }
00078 
00079   protected:
00081     virtual void handleNotification(Field* field);
00082 
00084     virtual void calculateOutputImageProperties(int outIndex);
00085 
00086   private:
00087 
00089 
00090     static KernelDataType _X[4];
00091     static KernelDataType _Y[4];
00092     static KernelDataType _RobertsCrossNormal[4];
00093     static KernelDataType _IndexKernel[4];
00095 
00097     EnumField *_whichRobertsOperatorFld;
00098 
00104     CALC_ROW_H();
00105 
00108     template <typename DATATYPE>                                            
00109       void calcRow(MLsoffset    *indexTab,
00110                    size_t       indexTabSize,          
00111                    MLsoffset    srcVoxelOffset,          
00112                    size_t       numVox,          
00113                    DATATYPE     *inCursor,                             
00114                    DATATYPE     *outCursor,
00115                    const ImageVector &/*rowStart*/);                           
00116 
00121     ML_MODULE_CLASS_HEADER(RobertsFilter);
00122  };
00123 
00124 ML_END_NAMESPACE
00125 
00126 #endif //of __mlRobertsFilter_H
00127 
00128