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