areaDetector  3-5-0
EPICS areaDetector framework
NDPluginProcess.h
Go to the documentation of this file.
1 #ifndef NDPluginProcess_H
2 #define NDPluginProcess_H
3 
4 #include <epicsTypes.h>
5 #include "NDPluginDriver.h"
6 
7 /* Background array subtraction */
8 #define NDPluginProcessSaveBackgroundString "SAVE_BACKGROUND" /* (asynInt32, r/w) Save the current frame as background */
9 #define NDPluginProcessEnableBackgroundString "ENABLE_BACKGROUND" /* (asynInt32, r/w) Enable background subtraction? */
10 #define NDPluginProcessValidBackgroundString "VALID_BACKGROUND" /* (asynInt32, r/o) Is there a valid background */
11 
12 /* Flat field normalization */
13 #define NDPluginProcessSaveFlatFieldString "SAVE_FLAT_FIELD" /* (asynInt32, r/w) Save the current frame as flat field */
14 #define NDPluginProcessEnableFlatFieldString "ENABLE_FLAT_FIELD" /* (asynInt32, r/w) Enable flat field normalization? */
15 #define NDPluginProcessValidFlatFieldString "VALID_FLAT_FIELD" /* (asynInt32, r/o) Is there a valid flat field */
16 #define NDPluginProcessScaleFlatFieldString "SCALE_FLAT_FIELD" /* (asynInt32, r/o) Scale factor after dividing by flat field */
17 
18 /* Offset and scaling */
19 #define NDPluginProcessEnableOffsetScaleString "ENABLE_OFFSET_SCALE" /* (asynInt32, r/w) Enable offset and scale? */
20 #define NDPluginProcessAutoOffsetScaleString "AUTO_OFFSET_SCALE" /* (asynInt32, r/w) Oneshot calc of scale and offset value from min and max values */
21 #define NDPluginProcessScaleString "SCALE" /* (asynFloat64, r/w) Scale value */
22 #define NDPluginProcessOffsetString "OFFSET" /* (asynFloat64, r/w) Offset value */
23 
24 /* High and low clipping */
25 #define NDPluginProcessLowClipString "LOW_CLIP" /* (asynFloat64, r/w) Low clip value */
26 #define NDPluginProcessEnableLowClipString "ENABLE_LOW_CLIP" /* (asynInt32, r/w) Enable low clipping? */
27 #define NDPluginProcessHighClipString "HIGH_CLIP" /* (asynFloat64, r/w) High clip value */
28 #define NDPluginProcessEnableHighClipString "ENABLE_HIGH_CLIP" /* (asynInt32, r/w) Enable high clipping? */
29 
30 /* Recursive filter */
31 #define NDPluginProcessEnableFilterString "ENABLE_FILTER" /* (asynInt32, r/w) Enable frame filtering? */
32 #define NDPluginProcessResetFilterString "RESET_FILTER" /* (asynInt32, r/w) Reset frame filtering when 1 */
33 #define NDPluginProcessAutoResetFilterString "AUTO_RESET_FILTER" /* (asynInt32, r/w) Auto-reset filter on N */
34 #define NDPluginProcessFilterCallbacksString "FILTER_CALLBACKS" /* (asynInt32, r/w) Only do callbacks on N */
35 #define NDPluginProcessNumFilterString "NUM_FILTER" /* (asynInt32, r/w) Number of frames to filter */
36 #define NDPluginProcessNumFilteredString "NUM_FILTERED" /* (asynInt32, r/o) Number of frames filtered */
37 #define NDPluginProcessOOffsetString "FILTER_OOFFSET" /* (asynFloat64, r/w) Output offset */
38 #define NDPluginProcessOScaleString "FILTER_OSCALE" /* (asynFloat64, r/w) Output scale */
39 #define NDPluginProcessOC1String "FILTER_OC1" /* (asynFloat64, r/w) Output coefficient 1 */
40 #define NDPluginProcessOC2String "FILTER_OC2" /* (asynFloat64, r/w) Output coefficient 2 */
41 #define NDPluginProcessOC3String "FILTER_OC3" /* (asynFloat64, r/w) Output coefficient 3 */
42 #define NDPluginProcessOC4String "FILTER_OC4" /* (asynFloat64, r/w) Output coefficient 4 */
43 #define NDPluginProcessFOffsetString "FILTER_FOFFSET" /* (asynFloat64, r/w) Filter offset */
44 #define NDPluginProcessFScaleString "FILTER_FSCALE" /* (asynFloat64, r/w) Filter scale */
45 #define NDPluginProcessFC1String "FILTER_FC1" /* (asynFloat64, r/w) Filter coefficient 1 */
46 #define NDPluginProcessFC2String "FILTER_FC2" /* (asynFloat64, r/w) Filter coefficient 2 */
47 #define NDPluginProcessFC3String "FILTER_FC3" /* (asynFloat64, r/w) Filter coefficient 3 */
48 #define NDPluginProcessFC4String "FILTER_FC4" /* (asynFloat64, r/w) Filter coefficient 4 */
49 #define NDPluginProcessROffsetString "FILTER_ROFFSET" /* (asynFloat64, r/w) Reset offset */
50 #define NDPluginProcessRC1String "FILTER_RC1" /* (asynFloat64, r/w) Reset coefficient 1 */
51 #define NDPluginProcessRC2String "FILTER_RC2" /* (asynFloat64, r/w) Reset coefficient 2 */
52 
53 /* Output data type */
54 #define NDPluginProcessDataTypeString "PROCESS_DATA_TYPE" /* (asynInt32, r/w) Output type. -1 means automatic. */
55 
56 
63 class epicsShareClass NDPluginProcess : public NDPluginDriver {
64 public:
65  NDPluginProcess(const char *portName, int queueSize, int blockingCallbacks,
66  const char *NDArrayPort, int NDArrayAddr,
67  int maxBuffers, size_t maxMemory,
68  int priority, int stackSize);
69  /* These methods override the virtual methods in the base class */
70  void processCallbacks(NDArray *pArray);
71  asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
72 
73 protected:
74  /* Background array subtraction */
76  #define FIRST_NDPLUGIN_PROCESS_PARAM NDPluginProcessSaveBackground
79 
80  /* Flat field normalization */
85 
86  /* Scale and offset */
91 
92  /* High and low clipping */
97 
98  /* Frame filtering */
120 
121  /* Output data type */
123 
124 private:
125  NDArray *pBackground;
126  size_t nBackgroundElements;
127  NDArray *pFlatField;
128  size_t nFlatFieldElements;
129  NDArray *pFilter;
130  int numFiltered;
131 };
132 
133 #endif
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:56
int NDPluginProcessScaleFlatField
Definition: NDPluginProcess.h:84
int NDPluginProcessEnableFlatField
Definition: NDPluginProcess.h:82
int NDPluginProcessEnableOffsetScale
Definition: NDPluginProcess.h:87
int NDPluginProcessEnableHighClip
Definition: NDPluginProcess.h:96
int NDPluginProcessFC4
Definition: NDPluginProcess.h:116
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:684
int NDPluginProcessAutoOffsetScale
Definition: NDPluginProcess.h:88
int NDPluginProcessValidBackground
Definition: NDPluginProcess.h:78
int NDPluginProcessFilterCallbacks
Definition: NDPluginProcess.h:102
Does image processing operations.
Definition: NDPluginProcess.h:63
int NDPluginProcessROffset
Definition: NDPluginProcess.h:117
list value
Definition: makeDbAndEdl.py:234
int NDPluginProcessResetFilter
Definition: NDPluginProcess.h:100
int NDPluginProcessValidFlatField
Definition: NDPluginProcess.h:83
int NDPluginProcessSaveFlatField
Definition: NDPluginProcess.h:81
int NDPluginProcessOC2
Definition: NDPluginProcess.h:108
int NDPluginProcessOC1
Definition: NDPluginProcess.h:107
int NDPluginProcessFScale
Definition: NDPluginProcess.h:112
int NDPluginProcessRC1
Definition: NDPluginProcess.h:118
int NDPluginProcessFC2
Definition: NDPluginProcess.h:114
int NDPluginProcessFOffset
Definition: NDPluginProcess.h:111
int NDPluginProcessSaveBackground
Definition: NDPluginProcess.h:75
int NDPluginProcessNumFilter
Definition: NDPluginProcess.h:103
int NDPluginProcessOOffset
Definition: NDPluginProcess.h:105
virtual void processCallbacks(NDArray *pArray)=0
int NDPluginProcessDataType
Definition: NDPluginProcess.h:122
int NDPluginProcessEnableLowClip
Definition: NDPluginProcess.h:94
int NDPluginProcessEnableBackground
Definition: NDPluginProcess.h:77
int NDPluginProcessAutoResetFilter
Definition: NDPluginProcess.h:101
int NDPluginProcessRC2
Definition: NDPluginProcess.h:119
int NDPluginProcessOC3
Definition: NDPluginProcess.h:109
int NDPluginProcessNumFiltered
Definition: NDPluginProcess.h:104
int NDPluginProcessFC1
Definition: NDPluginProcess.h:113
int NDPluginProcessEnableFilter
Definition: NDPluginProcess.h:99
int NDPluginProcessOffset
Definition: NDPluginProcess.h:90
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
int NDPluginProcessHighClip
Definition: NDPluginProcess.h:95
int NDPluginProcessOScale
Definition: NDPluginProcess.h:106
int NDPluginProcessLowClip
Definition: NDPluginProcess.h:93
int NDPluginProcessFC3
Definition: NDPluginProcess.h:115
int NDPluginProcessScale
Definition: NDPluginProcess.h:89
int NDPluginProcessOC4
Definition: NDPluginProcess.h:110