From 891b4e48abab13c35b668e50df9ce56a85684dfd Mon Sep 17 00:00:00 2001 From: rivers Date: Tue, 23 Sep 2008 13:33:55 +0000 Subject: [PATCH] Minor changes git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@7671 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b --- documentation/NDPluginROI.html | 59 ++++++++++++++------------- documentation/NDPluginStdArrays.html | 54 +++++++++++++++--------- documentation/pluginDoc.html | 61 ++++++++++++++++++---------- 3 files changed, 106 insertions(+), 68 deletions(-) diff --git a/documentation/NDPluginROI.html b/documentation/NDPluginROI.html index a3f1c42..0b6ea64 100755 --- a/documentation/NDPluginROI.html +++ b/documentation/NDPluginROI.html @@ -24,10 +24,10 @@ Overview

- NDPluginROI inherits from NDPluginDriver. NDPluginROI selects one or more rectangular - "Regions-Of-Interest" (ROIs) from the NDArray callback data. The maximum number - of ROIs is defined when the plugin is created. Each ROI can be any size, from a - single array element to the entire array. NDPluginROI does 3 things with these ROIs: + NDPluginROI selects one or more rectangular "Regions-Of-Interest" (ROIs) from the + NDArray callback data. The maximum number of ROIs is defined when the plugin is + created. Each ROI can be any size, from a single array element to the entire array. + NDPluginROI does 3 things with these ROIs:

  1. Computes statistics, e.g. mean, maximum, minimum, total value, net (background @@ -47,11 +47,13 @@ could be created for a single detector driver to increase the number of threads running in parallel, maximizing the use of multiple CPU cores. Individual ROIs are addressed through the asyn interfaces by the asyn "addr" field in the asynUser structure. - Note that while the NDPluginROI should be N-dimensional, the definition of the ROI - is currently limited to 2-D. This limitation will be removed in a future release. + Note that while the NDPluginROI should be N-dimensional, the EPICS interface to + the definition of the ROI is currently limited to 2-D. This limitation will be removed + in a future release.

    - The NDPluginROI public interface is defined in NDPluginROI.h as follows: + NDPluginROI inherits from NDPluginDriver. The NDPluginROI public interface is defined + in NDPluginROI.h as follows:

    class NDPluginROI : public NDPluginDriver {
     public:
    @@ -73,9 +75,9 @@ public:
       

    NDPluginROI.h defines the following parameters that are global to all ROIs for a - plugin. It also implements all of the standard plugin parameters from NDPlugDriver - listed above. The EPICS database NDROI.template provide access to these parameters, - listed in the following table. + plugin. It also implements all of the standard plugin parameters from NDPlugDriver. + The EPICS database NDROI.template provide access to these parameters, listed in + the following table.

    @@ -108,11 +110,11 @@ public: r/w + set then the borders of all ROIs will be highlighted in all other ROIs where they + overlap. One common use of this is to set the first ROI to be the entire detector, + and then the location of all other ROIs will be visible when the first ROI is displayed. + The highlighting is done by replacing the border pixels with the maximum value of + the data in that ROI. Statistics are computed before the highlighting is done. + the ROI of width NDPluginROIBgdWidth. This average background counts per element + is then subtracted from all elements inside the ROI.
    Flag to indicate if the borders of ROIs should be highlighted (0=No, 1=Yes). If - set then all ROIs will be highlighted in all other ROIs where they overlap. One - common use of this is to set the first ROI to be the entire detector, and then the - location of all other ROIs will be visible when the first ROI is displayed. The - highlighting is done by replacing the border pixels with the maximum value of the - data in that ROI. Statistics are computed before the highlighting is done. HIGHLIGHT @@ -509,8 +511,8 @@ public: Net (background subtracted) total of all elements in the ROI. The background is calculated by determining the average counts per array element in a border around - the ROI border of width NDPluginROIBgdWidth. This average background counts per - element is then subtracted from all elements inside the ROI. NET @@ -722,9 +724,9 @@ public: NDROI.png

    - The following is the MEDM screen that provides access to the parameters for in NDPluginROI.h - through records in NDROIN.template. This is the MEDM screen that is used to control - the behavior of a specific ROI. + The following is the MEDM screen that provides access to the parameters in NDPluginROI.h + for an individual ROI through records in NDROIN.template. This is the MEDM screen + that is used to control the behavior of a specific ROI.

    @@ -733,9 +735,9 @@ public: NDROIN.png

    - The following is another MEDM screen that provides access to the parameters for - in NDPluginROI.h through records in NDROIN.template. This is the MEDM screen that - is used to control the most commonly used properties of 8 ROIs. + The following is another MEDM screen that provides access to the parameters in NDPluginROI.h + through records in NDROIN.template. This is the MEDM screen that is used to control + the most commonly used properties of 8 ROIs.

    @@ -743,11 +745,12 @@ public: NDROI8.png

    - The following is an IDL epics_ad_display screen illustrating the highlighting of - ROIs. In this example the ROIs defined are those in the 8 ROI display above. The - NDPluginStdArrays driver has been configured to be receiving its NDArray callbacks - from the first ROI (which is defined to be the entire detector array), and the NDPluginROIHighlight - flag is set to Yes. + The following is an IDL + epics_ad_display screen illustrating the highlighting of ROIs. In this example + the ROIs defined are those in the 8 ROI display above. The NDPluginStdArrays driver + has been configured to be receiving its NDArray callbacks from the first ROI (which + is defined to be the entire detector array), and the NDPluginROIHighlight flag is + set to Yes.

    diff --git a/documentation/NDPluginStdArrays.html b/documentation/NDPluginStdArrays.html index 88bfca7..0cb78a2 100755 --- a/documentation/NDPluginStdArrays.html +++ b/documentation/NDPluginStdArrays.html @@ -20,6 +20,7 @@
  2. Configuration
  3. Screen shots
  4. IDL image display client
  5. +
  6. Future plans
  7. Overview @@ -33,10 +34,10 @@ data from a callback into the 1-dimensional arrays supported by the standard asyn array interfaces, i.e. asyn[Int8, Int16, Int32, Float32, Float64]Array. These interfaces are supported by the EPICS waveform record using standard asyn device support. Because - this plugin inherits from NDPluginDriver it also provides additional information - on the array data (e.g. number of dimensions and dimension data described above) - that are made available as EPICS PVs so that clients can correctly interpret the - array data. The NDPluginStdArrays public interface is defined in NDPluginStdArrays.h + this plugin inherits from NDPluginDriver + it also provides additional information on the array data (e.g. number of dimensions + and dimension data) that are made available as EPICS PVs so that clients can correctly + interpret the array data. The NDPluginStdArrays public interface is defined in NDPluginStdArrays.h as follows:

     class NDPluginStdArrays : public NDPluginDriver {
    @@ -64,13 +65,14 @@ public:
     

    NDPluginStdArrays defines the following parameters. It also implements all of the - standard plugin parameters from NDPlugDriver listed above. The EPICS database NDStdArrays.template - provides access to these parameters, listed in the following table. + standard plugin parameters from NDPluginDriver + . The EPICS database NDStdArrays.template provides access to these parameters, listed + in the following table.

    - @@ -195,18 +197,25 @@ public:

    IDL Image Display Client

    - There is an IDL program called epics_ad_display that can be used to - display 2-dimensional ArrayData that the NDStdArrays plugin sends to EPICS. This - IDL client is available as source code (which requires an IDL license), and also - as a pre-built IDL .sav file that can be run for free under the IDL Virtual Machine. - This IDL program can run on any machine that IDL runs on, and that has the ezcaIDL - shareable library built for it. This includes Windows, Linux, Solaris, and Mac. - epics_ad_display is included in the - CARS IDL imaging software. + There is an IDL procedure called + epics_ad_display that can be used to display 2-dimensional array data that + the NDStdArrays plugin sends to EPICS. This IDL client is available as source code + (which requires an IDL license), and also as a pre-built IDL .sav file that can + be run for free under the IDL Virtual Machine. This IDL program can run on any machine + that IDL runs on, and that has the ezcaIDL shareable library built for it. This + includes Windows, Linux, Solaris, and Mac. epics_ad_display is included + in the CARS IDL imaging + software.

    - The control window for epics_ad_display is shown below. It has fields - to input the base name of the EPICS PVs with the image data. The client uses the + The control window for epics_ad_display is shown below. It has a field + to input the base name of the EPICS PVs with the image data. It also has fields + to enable/display the IDL display update, to change the display mode, to autoscale + the intensity, and to invert the image in the Y direction. If autoscale is set to + No then manual scaling can be entered in the Min and Max fields. The number of frames + per second actually being displayed by IDL is shown. There is a status window that + shows whether the EPICS PVs are connected and the time the last was array received, + updated once per second.

    @@ -216,7 +225,7 @@ public:

    epics_ad_display can use the simple IDL routine tv to - display the images. This is the fasted mode, and results in a non-scaleable unadorned + display the images. This is the fastest mode, and results in a non-scalable unadorned window.

    @@ -228,7 +237,7 @@ public: epics_ad_display can also use the routine image_display.pro to display the images. This routine displays row and column profiles as the cursor is moved. It allows changing the color lookup tables, and - zooming in and out with the left and right mouse buttons. The following is an example + zooming in (right mouse click) and out (left mouse click). The following is an example of image_display displaying an image from the simulation detector.

    @@ -236,5 +245,12 @@ public:

    simDetector_image_display.png

    +

    + Future plans

    +

    + Stephen Mudie at the Australian Synchrotron has written a very nice IDL client to + display the EPICS images from the Flea Firewire cameras. This client should be converted + to display the data from this areaDetector plugin. +

    diff --git a/documentation/pluginDoc.html b/documentation/pluginDoc.html index c191c3e..de71034 100755 --- a/documentation/pluginDoc.html +++ b/documentation/pluginDoc.html @@ -7,7 +7,7 @@

    areaDetector Plugins

    - September 5, 2008

    + September 20, 2008

    Mark Rivers

    @@ -28,8 +28,8 @@ A powerful feature of the areaDetector module is the concept of plugins. A plugin is code that is called by a driver that passes NDArray data in a callback. Plugins can be used to process array data in real time. - Existing plugins convert data to standard asyn arrays (NDPluginStdArrays) save data - to disk (NDPluginFile), and select regions-of-interest (NDPluginROI). New plugins + Existing plugins convert data to standard asyn arrays (NDPluginStdArrays), save + data to disk (NDPluginFile), and select regions-of-interest (NDPluginROI). New plugins could be written to perform functions like finding the centroid of a beam, etc. Once a plugin is written it will work with any areaDetector driver. Plugins have the the following properties: @@ -40,15 +40,16 @@ is guaranteed to execute for each NDArray callback. However, it can slow down the driver, and does not utilize the multi-core capability of modern CPUs. In the non-blocking mode the driver callback simply places the NDArray data in a queue that is part - of the plugin. The plugin then executes the callback code in it own thread, removes + of the plugin. The plugin then executes the callback code in it own thread. It removes NDArray data from the queue, processes it, and releases the data back to the NDArrayPool when it is done. In the non-blocking mode some additional memory is required for the NDArray objects that are in the queue. It is also possible to drop NDArray data - if the queue is full, i.e. some callback data will not be processed. The non-blocking - mode can utilize the multi-core capabilities of modern CPUs because each plugin - is executing in its own thread. The operation of the queue and the NDArrayPool class - means that data never needs to be copied, each plugin has a pointer to the data - which will continue to be valid until the last plugin is done with it. + if the queue is full when a callback occurs, i.e. some callback data will not be + processed. The non-blocking mode can utilize the multi-core capabilities of modern + CPUs because each plugin is executing in its own thread. The operation of the queue + and the NDArrayPool class means that data never needs to be copied, each plugin + has a pointer to the data which will continue to be valid until the last plugin + is done with it.
  8. They can be enabled or disabled at run time.
  9. They can be throttled to only execute at a limited rate. This means, for example, that a detector can be saving data to disk at full speed, but images can be posted @@ -87,10 +88,6 @@ public: /* These are the methods that are new to this class */ virtual void processCallbacks(NDArray *pArray); - virtual void driverCallback(asynUser *pasynUser, void *genericPointer); - virtual void processTask(void); - virtual asynStatus setArrayInterrupt(int connect); - virtual asynStatus connectToArrayPort(void); int createFileName(int maxChars, char *fullFileName); ... } @@ -111,9 +108,9 @@ public: a parameter is not matched, then NDPluginDriver->drvUserCreate() will be called to see if it is a standard plugin parameter (defined in NDPluginDriver.h).
  10. processCallbacks This method is called each time a driver calls the - plugin with a new NDArray object. Derived classes typically call this base class - method, which handles some bookkeeping chores, and then they perform whatever operations - are specific to that plugin.
  11. + plugin with a new NDArray object. Derived classes typically provide an implementation + of this method that calls this base class method to perform some bookkeeping chores, + and then they perform whatever operations are specific to that plugin.
  12. createFileName This is a convenience function that constructs a complete file name in the ADFullFileName parameter from the ADFilePath, ADFileName, ADFileNumber, and ADFileTemplate parameters.
  13. @@ -184,7 +181,7 @@ public: NDARRAY_ADDR

    + $(P)$(R)NDArrayAddress_RBV @@ -207,7 +204,29 @@ public: ENABLE_CALLBACKS + $(P)$(R)EnableCallbacks_RBV + + + + + + + + + @@ -227,7 +246,7 @@ public: MIN_CALLBACK_TIME + $(P)$(R)MinCallbackTime_RBV @@ -245,7 +264,7 @@ public: ARRAY_COUNTER + $(P)$(R)ArrayCounter_RBV @@ -280,7 +299,7 @@ public: DROPPED_ARRAYS + $(P)$(R)DroppedArrays_RBV
    + Parameter Definitions in NDPluginStdArrays.h and EPICS Record Definitions in NDStdArrays.template
    $(P)$(R)NDArrayAddress
    - (P)$(R)NDArrayAddress_RBV
    longout
    longin
    $(P)$(R)EnableCallbacks
    - (P)$(R)EnableCallbacks_RBV
    + bo
    + bi
    + NDPluginDriverBlockingCallbacks + asynInt32 + r/w + 0 = callbacks from the driver do not block; the NDArray data is put on a queue and + the callback processes in its own thread. +
    + 1 = callbacks from the driver block; the callback processes in the driver callback + thread.
    + BLOCKING_CALLBACKS + $(P)$(R)CallbacksBlock
    + $(P)$(R)CallbacksBlock_RBV
    bo
    bi
    $(P)$(R)MinCallbackTime
    - (P)$(R)MinCallbackTime_RBV
    ao
    ai
    $(P)$(R)ArrayCounter
    - (P)$(R)ArrayCounter_RBV
    longout
    longin
    $(P)$(R)DroppedArrays
    - (P)$(R)DroppedArrays_RBV
    longout
    longin