MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
24
25//--------------------------------------------------
34//--------------------------------------------------
36{
37
38public:
39 //-------------------------------------------------------------------
42 //-------------------------------------------------------------------
44
45 //-------------------------------------------------------------------
48 //-------------------------------------------------------------------
49 inline IntField* getKernelXFld() const
50 {
51 return _kernelXFld;
52 }
53 inline IntField* getKernelYFld() const
54 {
55 return _kernelYFld;
56 }
57 inline IntField* getKernelZFld() const
58 {
59 return _kernelZFld;
60 }
61 inline IntField* getKernelCFld() const
62 {
63 return _kernelCFld;
64 }
65 inline IntField* getKernelTFld() const
66 {
67 return _kernelTFld;
68 }
69 inline IntField* getKernelUFld() const
70 {
71 return _kernelUFld;
72 }
73 inline IntField* getFieldWidthFld() const
74 {
75 return _fieldWidthFld;
76 }
77 inline IntField* getPrecisionFld() const
78 {
79 return _precisionFld;
80 }
81 inline DoubleField* getValueFld() const
82 {
83 return _valueFld;
84 }
85 inline NotifyField* getSetExtFld() const
86 {
87 return _setExtFld;
88 }
90 {
91 return _setElementValuesFld;
92 }
93 inline NotifyField* getFillFld() const
94 {
95 return _fillFld;
96 }
97 inline NotifyField* getAddFld() const
98 {
99 return _addFld;
100 }
101 inline NotifyField* getSubFld() const
102 {
103 return _subFld;
104 }
105 inline NotifyField* getMultFld() const
106 {
107 return _multFld;
108 }
109 inline NotifyField* getDivFld() const
110 {
111 return _divFld;
112 }
113 inline NotifyField* getSqrFld() const
114 {
115 return _sqrFld;
116 }
117 inline NotifyField* getSqrtFld() const
118 {
119 return _sqrtFld;
120 }
121 inline NotifyField* getInvDivFld() const
122 {
123 return _invDivFld;
124 }
125 inline NotifyField* getInvSubFld() const
126 {
127 return _invSubFld;
128 }
129 inline NotifyField* getPowFld() const
130 {
131 return _powFld;
132 }
133 inline NotifyField* getLogFld() const
134 {
135 return _logFld;
136 }
137 inline NotifyField* getGaussFld() const
138 {
139 return _gaussFld;
140 }
142 {
143 return _normalizeFld;
144 }
145 inline NotifyField* getSphereFld() const
146 {
147 return _sphereFld;
148 }
149 inline NotifyField* getMirrorFld() const
150 {
151 return _mirrorFld;
152 }
154 {
155 return _mirrorXFld;
156 }
158 {
159 return _mirrorYFld;
160 }
162 {
163 return _mirrorZFld;
164 }
166 {
167 return _mirrorCFld;
168 }
170 {
171 return _mirrorTFld;
172 }
174 {
175 return _mirrorUFld;
176 }
177 inline NotifyField* getUndoFld() const
178 {
179 return _undoFld;
180 }
181 inline NotifyField* getRedoFld() const
182 {
183 return _redoFld;
184 }
186 {
187 return _numElementsFld;
188 }
190 {
191 return _elementSumFld;
192 }
193 inline StringField* getInfoFld() const
194 {
195 return _infoFld;
196 }
198 {
199 return _kernelStringFld;
200 }
202
203private:
206 IntField* _kernelXFld;
207 IntField* _kernelYFld;
208 IntField* _kernelZFld;
209 IntField* _kernelCFld;
210 IntField* _kernelTFld;
211 IntField* _kernelUFld;
213
216 IntField* _fieldWidthFld;
217 IntField* _precisionFld;
219
221 DoubleField* _valueFld;
222
225 NotifyField* _setExtFld;
226 NotifyField* _setElementValuesFld;
227 NotifyField* _fillFld;
228 NotifyField* _addFld;
229 NotifyField* _subFld;
230 NotifyField* _multFld;
231 NotifyField* _divFld;
232 NotifyField* _sqrFld;
233 NotifyField* _sqrtFld;
234 NotifyField* _invDivFld;
235 NotifyField* _invSubFld;
236 NotifyField* _powFld;
237 NotifyField* _logFld;
238 NotifyField* _gaussFld;
239 NotifyField* _normalizeFld;
240 NotifyField* _sphereFld;
241 NotifyField* _mirrorFld;
242 NotifyField* _mirrorXFld;
243 NotifyField* _mirrorYFld;
244 NotifyField* _mirrorZFld;
245 NotifyField* _mirrorCFld;
246 NotifyField* _mirrorTFld;
247 NotifyField* _mirrorUFld;
248 NotifyField* _undoFld;
249 NotifyField* _redoFld;
251
253 IntField* _numElementsFld;
254
256 DoubleField* _elementSumFld;
257
259 StringField* _infoFld;
260
262 StringField* _kernelStringFld;
263
264protected:
267 void activateAttachments() override;
268
271
273 virtual void _stringToKernel(bool addToUndo = true);
274
276 virtual void _kernelToString(bool addToUndo = true);
277
279 virtual void _updateInfo(std::string errString = "");
280
285
288
290 std::vector<std::string> _undoList;
291
293 std::vector<std::string> _redoList;
294
295
296 //------------------------------
297 // Pass kernel as output image.
298 //------------------------------
301 {
302 return SubImageBox();
303 }
304
307
309 void calculateOutputSubImage(SubImage* outSubImg, int /*outIndex*/, SubImage* /*inSubImgs*/) override;
310
312 template <typename DATATYPE> void calculateOutputSubImage(TSubImage<DATATYPE>* outSubImg, int outIndex);
313
314
320};
321
323
324#endif // of __mlKernelEditor_H
Field to encapsulate a double value.
Definition mlFields.h:567
Base class for all fields used in the ML.
Definition mlField.h:73
Field to encapsulate an integer value.
Definition mlFields.h:123
The class to edit a 6D kernel.
IntField * getKernelUFld() const
IntField * getKernelXFld() const
NotifyField * getPowFld() const
std::vector< std::string > _undoList
List of strings to push recent kernels.
NotifyField * getDivFld() const
StringField * getKernelStringFld() const
NotifyField * getSphereFld() const
NotifyField * getInvDivFld() const
DoubleField * getValueFld() const
virtual void _updateInfo(std::string errString="")
Update the kernel information line with kernel infos or error lines.
NotifyField * getMirrorFld() const
NotifyField * getSetElementValuesFld() const
void calculateOutputImageProperties(int outIndex, PagedImage *outputImage) override
Return kernel size as output image size. Set page size to 64x64x1x1x1x1.
NotifyField * getSubFld() const
void activateAttachments() override
Called when field settings are finished after load.
NotifyField * getSqrFld() const
NotifyField * getMirrorCFld() const
NotifyField * getInvSubFld() const
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.
IntField * getFieldWidthFld() const
IntField * getKernelYFld() const
IntField * getKernelCFld() const
IntField * getKernelTFld() const
void calculateOutputSubImage(SubImage *outSubImg, int, SubImage *) override
Implements the call of calculateOutputSubImage() for all data types.
NotifyField * getMirrorUFld() 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 * getGaussFld() const
NotifyField * getNormalizeFld() const
NotifyField * getLogFld() const
NotifyField * getSetExtFld() const
ML_MODULE_CLASS_HEADER(KernelEditor)
Macro to declare methods for the runtime system, defined in mlRuntimeSubClass.h.
IntField * getKernelZFld() const
NotifyField * getRedoFld() const
IntField * getNumElementsFld() const
MLint _recEntries
Counter for recursive entries in handleNotifications.
void calculateOutputSubImage(TSubImage< DATATYPE > *outSubImg, int outIndex)
Return kernel as output image.
NotifyField * getMirrorZFld() const
NotifyField * getSqrtFld() const
NotifyField * getAddFld() const
std::vector< std::string > _redoList
List of strings to redo recent kernels.
IntField * getPrecisionFld() const
KernelEditor()
Constructor.
NotifyField * getMirrorXFld() const
NotifyField * getFillFld() const
NotifyField * getMirrorYFld() const
NotifyField * getMirrorTFld() const
NotifyField * getUndoFld() 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 * getElementSumFld() const
StringField * getInfoFld() const
Base class for an image processing module of the ML.
Definition mlModule.h:150
Field without value for notifications.
Definition mlFields.h:687
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
Field to encapsulate a string value.
Definition mlFields.h:634
This class manages/represents a rectangular 6D image region that is organized linearly in memory.
Definition mlSubImage.h:75
This template class manages/represents a rectangular 6D image region in memory that is organized line...
Definition mlTSubImage.h:99
#define MLKERNELEXPORT
Includes files used in many parts of the dll, defined dll-specific macros and controls any system dep...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489
TSubImageBox< MLint > SubImageBox
Defines the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type...