MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLKernel/mlKernelEditor.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //-------------------------------------------------------------------------
00004 
00009 //-------------------------------------------------------------------------
00010 // Prevents multiple including of this file.
00011 #if !defined(__mlKernelEditor_H)
00012 #define __mlKernelEditor_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 
00022 ML_START_NAMESPACE
00023 
00024   //--------------------------------------------------
00033   //--------------------------------------------------
00034   class MLKERNELEXPORT KernelEditor : public Module{
00035 
00036   public: 
00037 
00038     //-------------------------------------------------------------------
00041     //-------------------------------------------------------------------
00042     KernelEditor();
00043 
00044     //-------------------------------------------------------------------
00046 
00047     //-------------------------------------------------------------------
00048     inline IntField     *getKernelXFld         () const { return _kernelXFld         ; }
00049     inline IntField     *getKernelYFld         () const { return _kernelYFld         ; }
00050     inline IntField     *getKernelZFld         () const { return _kernelZFld         ; }
00051     inline IntField     *getKernelCFld         () const { return _kernelCFld         ; }
00052     inline IntField     *getKernelTFld         () const { return _kernelTFld         ; }
00053     inline IntField     *getKernelUFld         () const { return _kernelUFld         ; }
00054     inline IntField     *getFieldWidthFld      () const { return _fieldWidthFld      ; }
00055     inline IntField     *getPrecisionFld       () const { return _precisionFld       ; }
00056     inline DoubleField  *getValueFld           () const { return _valueFld           ; }
00057     inline NotifyField  *getSetExtFld          () const { return _setExtFld          ; }
00058     inline NotifyField  *getSetElementValuesFld() const { return _setElementValuesFld; }
00059     inline NotifyField  *getFillFld            () const { return _fillFld            ; }
00060     inline NotifyField  *getAddFld             () const { return _addFld             ; }
00061     inline NotifyField  *getSubFld             () const { return _subFld             ; }
00062     inline NotifyField  *getMultFld            () const { return _multFld            ; }
00063     inline NotifyField  *getDivFld             () const { return _divFld             ; }
00064     inline NotifyField  *getSqrFld             () const { return _sqrFld             ; }
00065     inline NotifyField  *getSqrtFld            () const { return _sqrtFld            ; }
00066     inline NotifyField  *getInvDivFld          () const { return _invDivFld          ; }
00067     inline NotifyField  *getInvSubFld          () const { return _invSubFld          ; }
00068     inline NotifyField  *getPowFld             () const { return _powFld             ; }
00069     inline NotifyField  *getLogFld             () const { return _logFld             ; }
00070     inline NotifyField  *getGaussFld           () const { return _gaussFld           ; }
00071     inline NotifyField  *getNormalizeFld       () const { return _normalizeFld       ; }
00072     inline NotifyField  *getSphereFld          () const { return _sphereFld          ; }
00073     inline NotifyField  *getMirrorFld          () const { return _mirrorFld          ; }
00074     inline NotifyField  *getMirrorXFld         () const { return _mirrorXFld         ; }
00075     inline NotifyField  *getMirrorYFld         () const { return _mirrorYFld         ; }
00076     inline NotifyField  *getMirrorZFld         () const { return _mirrorZFld         ; }
00077     inline NotifyField  *getMirrorCFld         () const { return _mirrorCFld         ; }
00078     inline NotifyField  *getMirrorTFld         () const { return _mirrorTFld         ; }
00079     inline NotifyField  *getMirrorUFld         () const { return _mirrorUFld         ; }
00080     inline NotifyField  *getUndoFld            () const { return _undoFld            ; }
00081     inline NotifyField  *getRedoFld            () const { return _redoFld            ; }
00082     inline IntField     *getNumElementsFld     () const { return _numElementsFld     ; }
00083     inline DoubleField  *getElementSumFld      () const { return _elementSumFld      ; }
00084     inline StringField  *getInfoFld            () const { return _infoFld            ; }
00085     inline StringField  *getKernelStringFld    () const { return _kernelStringFld    ; }
00087 
00088   private:
00090 
00091     IntField     *_kernelXFld;
00092     IntField     *_kernelYFld;
00093     IntField     *_kernelZFld;
00094     IntField     *_kernelCFld;
00095     IntField     *_kernelTFld;
00096     IntField     *_kernelUFld;
00098 
00100 
00101     IntField     *_fieldWidthFld;
00102     IntField     *_precisionFld;
00104     
00106     DoubleField  *_valueFld;
00107 
00109 
00110     NotifyField  *_setExtFld;
00111     NotifyField  *_setElementValuesFld;
00112     NotifyField  *_fillFld;
00113     NotifyField  *_addFld;
00114     NotifyField  *_subFld;
00115     NotifyField  *_multFld;
00116     NotifyField  *_divFld;
00117     NotifyField  *_sqrFld;
00118     NotifyField  *_sqrtFld;
00119     NotifyField  *_invDivFld;
00120     NotifyField  *_invSubFld;
00121     NotifyField  *_powFld;
00122     NotifyField  *_logFld;
00123     NotifyField  *_gaussFld;
00124     NotifyField  *_normalizeFld;
00125     NotifyField  *_sphereFld;
00126     NotifyField  *_mirrorFld;
00127     NotifyField  *_mirrorXFld;
00128     NotifyField  *_mirrorYFld;
00129     NotifyField  *_mirrorZFld;
00130     NotifyField  *_mirrorCFld;
00131     NotifyField  *_mirrorTFld;
00132     NotifyField  *_mirrorUFld;
00133     NotifyField  *_undoFld;
00134     NotifyField  *_redoFld;
00136 
00138     IntField     *_numElementsFld;
00139     
00141     DoubleField  *_elementSumFld;
00142     
00144     StringField  *_infoFld;
00145     
00147     StringField  *_kernelStringFld;
00148 
00149   protected:
00152     virtual void activateAttachments();
00153 
00155     virtual void handleNotification(Field* field);
00156 
00158     virtual void _stringToKernel(bool addToUndo=true);
00159 
00161     virtual void _kernelToString(bool addToUndo=true);
00162 
00164     virtual void _updateInfo(std::string errString ="");
00165 
00167 
00168 
00169     Kernel _kernel;
00170 
00172     MLint _recEntries;
00173 
00175     std::vector<std::string> _undoList;
00176 
00178     std::vector<std::string> _redoList;
00179 
00180 
00181     //------------------------------
00182     // Pass kernel as output image.
00183     //------------------------------
00185     SubImageBox calculateInputSubImageBox(int, const SubImageBox&, int) { return SubImageBox(); }
00186 
00188     void calculateOutputImageProperties(int /*outIndex*/);
00189 
00191     void calculateOutputSubImage(SubImage *outSubImg, int /*outIndex*/, SubImage * /*inSubImgs*/);
00192 
00194     template <typename DATATYPE> void calculateOutputSubImage(TSubImage<DATATYPE> *outSubImg, int outIndex);
00195 
00196 
00201     ML_MODULE_CLASS_HEADER(KernelEditor);
00202  };
00203 
00204 ML_END_NAMESPACE
00205 
00206 #endif //of __mlKernelEditor_H
00207 
00208