Minor changes
git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@7671 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b
This commit is contained in:
@@ -24,10 +24,10 @@
|
||||
Overview
|
||||
</h2>
|
||||
<p>
|
||||
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:
|
||||
</p>
|
||||
<ol>
|
||||
<li>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.
|
||||
</p>
|
||||
<p>
|
||||
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:
|
||||
</p>
|
||||
<pre>class NDPluginROI : public NDPluginDriver {
|
||||
public:
|
||||
@@ -73,9 +75,9 @@ public:
|
||||
</p>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<table border="1" cellpadding="2" cellspacing="2" style="text-align: left">
|
||||
<tbody>
|
||||
@@ -108,11 +110,11 @@ public:
|
||||
r/w</td>
|
||||
<td>
|
||||
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.</td>
|
||||
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.</td>
|
||||
<td>
|
||||
HIGHLIGHT</td>
|
||||
<td>
|
||||
@@ -509,8 +511,8 @@ public:
|
||||
<td>
|
||||
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.</td>
|
||||
the ROI of width NDPluginROIBgdWidth. This average background counts per element
|
||||
is then subtracted from all elements inside the ROI.</td>
|
||||
<td>
|
||||
NET</td>
|
||||
<td>
|
||||
@@ -722,9 +724,9 @@ public:
|
||||
<img alt="NDROI.png" src="NDROI.png" />
|
||||
</div>
|
||||
<p>
|
||||
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.
|
||||
<br />
|
||||
</p>
|
||||
<div style="text-align: center">
|
||||
@@ -733,9 +735,9 @@ public:
|
||||
<img alt="NDROIN.png" src="NDROIN.png" />
|
||||
</div>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<div style="text-align: center">
|
||||
<h3>
|
||||
@@ -743,11 +745,12 @@ public:
|
||||
<img alt="NDROI8.png" src="NDROI8.png" />
|
||||
</div>
|
||||
<p>
|
||||
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 <a href="http://cars.uchicago.edu/software/idl/imaging_routines.html#epics_ad_display">
|
||||
epics_ad_display</a> 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.
|
||||
</p>
|
||||
<div style="text-align: center">
|
||||
<h3>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<li><a href="#Configuration">Configuration</a></li>
|
||||
<li><a href="#Screens">Screen shots</a></li>
|
||||
<li><a href="#IDLClient">IDL image display client</a></li>
|
||||
<li><a href="#Future">Future plans</a></li>
|
||||
</ul>
|
||||
<h2 id="Overview">
|
||||
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 <a href="pluginDoc.html#NDPluginDriver">NDPluginDriver</a>
|
||||
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:</p>
|
||||
<pre>
|
||||
class NDPluginStdArrays : public NDPluginDriver {
|
||||
@@ -64,13 +65,14 @@ public:
|
||||
</pre>
|
||||
<p>
|
||||
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 <a href="pluginDoc.html#NDPluginDriver">NDPluginDriver</a>
|
||||
. The EPICS database NDStdArrays.template provides access to these parameters, listed
|
||||
in the following table.
|
||||
</p>
|
||||
<table border="1" cellpadding="2" cellspacing="2" style="text-align: left">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="CENTER" colspan="7,">
|
||||
<td align="center" colspan="7,">
|
||||
<b>Parameter Definitions in NDPluginStdArrays.h and EPICS Record Definitions in NDStdArrays.template</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -195,18 +197,25 @@ public:
|
||||
<h2 id="IDLClient">
|
||||
IDL Image Display Client</h2>
|
||||
<p>
|
||||
There is an IDL program called <code>epics_ad_display</code> 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.
|
||||
<code>epics_ad_display</code> is included in the <a href="http://cars.uchicago.edu/software/IDL/imaging.html">
|
||||
CARS IDL imaging software.</a>
|
||||
There is an IDL procedure called <a href="http://cars.uchicago.edu/software/idl/imaging_routines.html#epics_ad_display">
|
||||
epics_ad_display</a> 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. <code>epics_ad_display</code> is included
|
||||
in the <a href="http://cars.uchicago.edu/software/IDL/imaging.html">CARS IDL imaging
|
||||
software.</a>
|
||||
</p>
|
||||
<p>
|
||||
The control window for <code>epics_ad_display</code> 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 <code>epics_ad_display</code> 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.
|
||||
</p>
|
||||
<div style="text-align: center">
|
||||
<h3>
|
||||
@@ -216,7 +225,7 @@ public:
|
||||
</div>
|
||||
<p>
|
||||
<code>epics_ad_display</code> can use the simple IDL routine <code>tv</code> 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.</p>
|
||||
<div style="text-align: center">
|
||||
<h3>
|
||||
@@ -228,7 +237,7 @@ public:
|
||||
<code>epics_ad_display</code> can also use the routine <a href="http://cars.uchicago.edu/software/IDL/imaging_routines.html#IMAGE_DISPLAY">
|
||||
image_display.pro</a> 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 <code>image_display</code> displaying an image from the simulation detector.</p>
|
||||
<div style="text-align: center">
|
||||
<h3>
|
||||
@@ -236,5 +245,12 @@ public:
|
||||
<p>
|
||||
<img alt="simDetector_image_display.png" src="simDetector_image_display.png" /></p>
|
||||
</div>
|
||||
<h2 id="Future">
|
||||
Future plans</h2>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h1>
|
||||
areaDetector Plugins</h1>
|
||||
<h2>
|
||||
September 5, 2008</h2>
|
||||
September 20, 2008</h2>
|
||||
<h2>
|
||||
Mark Rivers</h2>
|
||||
<h2>
|
||||
@@ -28,8 +28,8 @@
|
||||
A powerful feature of the <a href="areaDetectorDoc.html">areaDetector</a> 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.</li>
|
||||
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.</li>
|
||||
<li>They can be enabled or disabled at run time.</li>
|
||||
<li>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).</li>
|
||||
<li><code>processCallbacks</code> 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.</li>
|
||||
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.</li>
|
||||
<li><code>createFileName</code> This is a convenience function that constructs a complete
|
||||
file name in the ADFullFileName parameter from the ADFilePath, ADFileName, ADFileNumber,
|
||||
and ADFileTemplate parameters.</li>
|
||||
@@ -184,7 +181,7 @@ public:
|
||||
NDARRAY_ADDR</td>
|
||||
<td>
|
||||
$(P)$(R)NDArrayAddress<br />
|
||||
(P)$(R)NDArrayAddress_RBV</td>
|
||||
$(P)$(R)NDArrayAddress_RBV</td>
|
||||
<td>
|
||||
longout<br />
|
||||
longin</td>
|
||||
@@ -207,7 +204,29 @@ public:
|
||||
ENABLE_CALLBACKS</td>
|
||||
<td>
|
||||
$(P)$(R)EnableCallbacks<br />
|
||||
(P)$(R)EnableCallbacks_RBV</td>
|
||||
$(P)$(R)EnableCallbacks_RBV</td>
|
||||
<td>
|
||||
bo<br />
|
||||
bi</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
NDPluginDriverBlockingCallbacks</td>
|
||||
<td>
|
||||
asynInt32</td>
|
||||
<td>
|
||||
r/w</td>
|
||||
<td>
|
||||
0 = callbacks from the driver do not block; the NDArray data is put on a queue and
|
||||
the callback processes in its own thread.
|
||||
<br />
|
||||
1 = callbacks from the driver block; the callback processes in the driver callback
|
||||
thread.</td>
|
||||
<td>
|
||||
BLOCKING_CALLBACKS</td>
|
||||
<td>
|
||||
$(P)$(R)CallbacksBlock<br />
|
||||
$(P)$(R)CallbacksBlock_RBV</td>
|
||||
<td>
|
||||
bo<br />
|
||||
bi</td>
|
||||
@@ -227,7 +246,7 @@ public:
|
||||
MIN_CALLBACK_TIME</td>
|
||||
<td>
|
||||
$(P)$(R)MinCallbackTime<br />
|
||||
(P)$(R)MinCallbackTime_RBV</td>
|
||||
$(P)$(R)MinCallbackTime_RBV</td>
|
||||
<td>
|
||||
ao<br />
|
||||
ai</td>
|
||||
@@ -245,7 +264,7 @@ public:
|
||||
ARRAY_COUNTER</td>
|
||||
<td>
|
||||
$(P)$(R)ArrayCounter<br />
|
||||
(P)$(R)ArrayCounter_RBV</td>
|
||||
$(P)$(R)ArrayCounter_RBV</td>
|
||||
<td>
|
||||
longout<br />
|
||||
longin</td>
|
||||
@@ -280,7 +299,7 @@ public:
|
||||
DROPPED_ARRAYS</td>
|
||||
<td>
|
||||
$(P)$(R)DroppedArrays<br />
|
||||
(P)$(R)DroppedArrays_RBV</td>
|
||||
$(P)$(R)DroppedArrays_RBV</td>
|
||||
<td>
|
||||
longout<br />
|
||||
longin</td>
|
||||
|
||||
Reference in New Issue
Block a user