MeVisLab Toolbox Reference
mlKernelEditor.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
15 
16 #if !defined(__mlKernelEditor_H)
17 #define __mlKernelEditor_H
18 
19 // ML-includes
20 #include "mlInitSystemKernel.h"
21 #include "mlKernel.h"
22 
23 ML_START_NAMESPACE
24 
25  //--------------------------------------------------
34  //--------------------------------------------------
36 
37  public:
38 
39  //-------------------------------------------------------------------
42  //-------------------------------------------------------------------
44 
45  //-------------------------------------------------------------------
48  //-------------------------------------------------------------------
49  inline IntField *getKernelXFld () const { return _kernelXFld ; }
50  inline IntField *getKernelYFld () const { return _kernelYFld ; }
51  inline IntField *getKernelZFld () const { return _kernelZFld ; }
52  inline IntField *getKernelCFld () const { return _kernelCFld ; }
53  inline IntField *getKernelTFld () const { return _kernelTFld ; }
54  inline IntField *getKernelUFld () const { return _kernelUFld ; }
55  inline IntField *getFieldWidthFld () const { return _fieldWidthFld ; }
56  inline IntField *getPrecisionFld () const { return _precisionFld ; }
57  inline DoubleField *getValueFld () const { return _valueFld ; }
58  inline NotifyField *getSetExtFld () const { return _setExtFld ; }
59  inline NotifyField *getSetElementValuesFld() const { return _setElementValuesFld; }
60  inline NotifyField *getFillFld () const { return _fillFld ; }
61  inline NotifyField *getAddFld () const { return _addFld ; }
62  inline NotifyField *getSubFld () const { return _subFld ; }
63  inline NotifyField *getMultFld () const { return _multFld ; }
64  inline NotifyField *getDivFld () const { return _divFld ; }
65  inline NotifyField *getSqrFld () const { return _sqrFld ; }
66  inline NotifyField *getSqrtFld () const { return _sqrtFld ; }
67  inline NotifyField *getInvDivFld () const { return _invDivFld ; }
68  inline NotifyField *getInvSubFld () const { return _invSubFld ; }
69  inline NotifyField *getPowFld () const { return _powFld ; }
70  inline NotifyField *getLogFld () const { return _logFld ; }
71  inline NotifyField *getGaussFld () const { return _gaussFld ; }
72  inline NotifyField *getNormalizeFld () const { return _normalizeFld ; }
73  inline NotifyField *getSphereFld () const { return _sphereFld ; }
74  inline NotifyField *getMirrorFld () const { return _mirrorFld ; }
75  inline NotifyField *getMirrorXFld () const { return _mirrorXFld ; }
76  inline NotifyField *getMirrorYFld () const { return _mirrorYFld ; }
77  inline NotifyField *getMirrorZFld () const { return _mirrorZFld ; }
78  inline NotifyField *getMirrorCFld () const { return _mirrorCFld ; }
79  inline NotifyField *getMirrorTFld () const { return _mirrorTFld ; }
80  inline NotifyField *getMirrorUFld () const { return _mirrorUFld ; }
81  inline NotifyField *getUndoFld () const { return _undoFld ; }
82  inline NotifyField *getRedoFld () const { return _redoFld ; }
83  inline IntField *getNumElementsFld () const { return _numElementsFld ; }
84  inline DoubleField *getElementSumFld () const { return _elementSumFld ; }
85  inline StringField *getInfoFld () const { return _infoFld ; }
86  inline StringField *getKernelStringFld () const { return _kernelStringFld ; }
88 
89  private:
92  IntField *_kernelXFld;
93  IntField *_kernelYFld;
94  IntField *_kernelZFld;
95  IntField *_kernelCFld;
96  IntField *_kernelTFld;
97  IntField *_kernelUFld;
99 
102  IntField *_fieldWidthFld;
103  IntField *_precisionFld;
105 
107  DoubleField *_valueFld;
108 
111  NotifyField *_setExtFld;
112  NotifyField *_setElementValuesFld;
113  NotifyField *_fillFld;
114  NotifyField *_addFld;
115  NotifyField *_subFld;
116  NotifyField *_multFld;
117  NotifyField *_divFld;
118  NotifyField *_sqrFld;
119  NotifyField *_sqrtFld;
120  NotifyField *_invDivFld;
121  NotifyField *_invSubFld;
122  NotifyField *_powFld;
123  NotifyField *_logFld;
124  NotifyField *_gaussFld;
125  NotifyField *_normalizeFld;
126  NotifyField *_sphereFld;
127  NotifyField *_mirrorFld;
128  NotifyField *_mirrorXFld;
129  NotifyField *_mirrorYFld;
130  NotifyField *_mirrorZFld;
131  NotifyField *_mirrorCFld;
132  NotifyField *_mirrorTFld;
133  NotifyField *_mirrorUFld;
134  NotifyField *_undoFld;
135  NotifyField *_redoFld;
137 
139  IntField *_numElementsFld;
140 
142  DoubleField *_elementSumFld;
143 
145  StringField *_infoFld;
146 
148  StringField *_kernelStringFld;
149 
150  protected:
153  void activateAttachments() override;
154 
156  void handleNotification(Field* field) override;
157 
159  virtual void _stringToKernel(bool addToUndo=true);
160 
162  virtual void _kernelToString(bool addToUndo=true);
163 
165  virtual void _updateInfo(std::string errString ="");
166 
171 
174 
176  std::vector<std::string> _undoList;
177 
179  std::vector<std::string> _redoList;
180 
181 
182  //------------------------------
183  // Pass kernel as output image.
184  //------------------------------
186  SubImageBox calculateInputSubImageBox(int, const SubImageBox&, int) override { return SubImageBox(); }
187 
189  void calculateOutputImageProperties(int outIndex, PagedImage* outputImage) override;
190 
192  void calculateOutputSubImage(SubImage *outSubImg, int /*outIndex*/, SubImage * /*inSubImgs*/) override;
193 
195  template <typename DATATYPE> void calculateOutputSubImage(TSubImage<DATATYPE> *outSubImg, int outIndex);
196 
197 
203  };
204 
205 ML_END_NAMESPACE
206 
207 #endif //of __mlKernelEditor_H
208 
209 
Field to encapsulate a double value.
Definition: mlFields.h:806
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate an integer value.
Definition: mlFields.h:161
The class to edit a 6D kernel.
NotifyField * getPowFld() const
std::vector< std::string > _undoList
List of strings to push recent kernels.
NotifyField * getSqrtFld() const
DoubleField * getElementSumFld() const
virtual void _updateInfo(std::string errString="")
Update the kernel information line with kernel infos or error lines.
NotifyField * getGaussFld() const
IntField * getKernelCFld() const
IntField * getPrecisionFld() const
void calculateOutputImageProperties(int outIndex, PagedImage *outputImage) override
Return kernel size as output image size. Set page size to 64x64x1x1x1x1.
IntField * getKernelZFld() const
void activateAttachments() override
Called when field settings are finished after load.
NotifyField * getMultFld() const
virtual void _stringToKernel(bool addToUndo=true)
Converts current editor string to a kernel and append it to the undo list if addToUndo is true.
NotifyField * getDivFld() const
NotifyField * getMirrorCFld() const
NotifyField * getUndoFld() const
NotifyField * getMirrorTFld() const
IntField * getKernelXFld() const
NotifyField * getSetElementValuesFld() const
void calculateOutputSubImage(SubImage *outSubImg, int, SubImage *) override
Implements the call of calculateOutputSubImage() for all data types.
NotifyField * getFillFld() const
NotifyField * getInvSubFld() const
NotifyField * getMirrorZFld() const
NotifyField * getInvDivFld() const
IntField * getKernelUFld() const
StringField * getKernelStringFld() const
StringField * getInfoFld() const
NotifyField * getMirrorFld() const
SubImageBox calculateInputSubImageBox(int, const SubImageBox &, int) override
We don't need any input image to calculate the output. So return an empty box.
void handleNotification(Field *field) override
Called when a parameter field is changed.
NotifyField * getAddFld() const
NotifyField * getRedoFld() const
NotifyField * getMirrorYFld() const
IntField * getFieldWidthFld() const
NotifyField * getSubFld() const
NotifyField * getSqrFld() const
ML_MODULE_CLASS_HEADER(KernelEditor)
Macro to declare methods for the runtime system, defined in mlRuntimeSubClass.h.
MLint _recEntries
Counter for recursive entries in handleNotifications.
IntField * getNumElementsFld() const
IntField * getKernelYFld() const
NotifyField * getMirrorUFld() const
void calculateOutputSubImage(TSubImage< DATATYPE > *outSubImg, int outIndex)
Return kernel as output image.
std::vector< std::string > _redoList
List of strings to redo recent kernels.
NotifyField * getMirrorXFld() const
NotifyField * getLogFld() const
KernelEditor()
Constructor.
IntField * getKernelTFld() const
NotifyField * getSphereFld() const
NotifyField * getNormalizeFld() const
NotifyField * getSetExtFld() const
virtual void _kernelToString(bool addToUndo=true)
Converts the current kernel to the editor string and append it to the undo list if addToUndo is true.
DoubleField * getValueFld() const
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field without value for notifications.
Definition: mlFields.h:1049
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
Field to encapsulate a string value.
Definition: mlFields.h:1000
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition: mlSubImage.h:75
This template class manages/represents a rectangular 6d image region in memory which is organized lin...
Definition: mlTSubImage.h:110
#define MLKERNELEXPORT
Includes files used in many parts of the dll, defined dll-specific macros and controls any system dep...
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
TSubImageBox< MLint > SubImageBox
Define the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type.