areaDetector Plugin NDPluginTransform

August 30, 2014

Christian Roehrig, Mark Rivers, John Hammonds

Argonne National Laboratory

Contents

Overview

This plugin provides 8 choices for image transforms that involve rotations by multiples of 90 degrees and mirror reflections about the central vertical line of the image. The plugin supports only 2-D monochrome and color images (RGB1, RGB2, and RGB3).

NDPluginTransform inherits from NDPluginDriver. The NDPluginTransform class documentation describes this class in detail.

NDPluginTransform.h defines the following parameters. It also implements all of the standard plugin parameters from NDPluginDriver. The EPICS database NDransform.template provide access to these parameters, listed in the following table. Note that to reduce the width of this table the parameter index variable names have been split into 2 lines, but these are just a single name, for example NDPluginTransformType.

Parameter Definitions in NDPluginTransform.h and EPICS Record Definitions in NDTransform.template
Parameter index variable asyn interface Access Description drvInfo string EPICS record name EPICS record type
NDPluginTransform
Type
asynInt32 r/w Type of transform TRANSFORM_TYPE $(P)$(R)Type. Choices are:
  • None: No transform, the output image is the same as the input image.
  • Rot90: Rotate clockwise 90 degrees.
  • Rot180: Rotate clockwise 180 degrees.
  • Rot270: Rotate clockwise 270 degrees; equivalent to counter-clockwise rotation by 90 degrees.
  • Mirror: Mirror reflection about the central column in the image.
  • Rot90Mirror: Rot90 followed by Mirror. Equivalent to image transpose, swapping rows and columns.
  • Rot180Mirror: Rot180 followed by Mirror. Equivalent to a mirror reflection about the central row in the image.
  • Rot270Mirror: Rot270 followed by Mirror. Equivalent to image transpose followed by mirror reflection about the central column in the image.
mbbo

Configuration

The NDPluginTransform plugin is created with the NDTransformConfigure command, either from C/C++ or from the EPICS IOC shell.

NDTransformConfigure(const char *portName, int queueSize, int blockingCallbacks,
               const char *NDArrayPort, int NDArrayAddr,
               int maxBuffers, size_t maxMemory,
               int priority, int stackSize)
  

For details on the meaning of the parameters to this function refer to the detailed documentation on the NDTransformConfigure function in the NDPluginROI.cpp documentation and in the documentation for the constructor for the NDPluginTransform class.

Screen shots

The following MEDM screen provides access to the parameters in NDPluginDriver.h and NDPluginTransform.h through records in NDPluginBase.template and NDTransform.template. The orientation of the letter F on the screen shows what each transform type does.

NDTransform.adl

NDTransform.png

Performance

The following is a measurement of the performance of the NDPluginTransform plugin in release R2-1. The measurements were done with the simDetector on an 8-core Linux machine. All plugins except the NDPluginTransform plugin were disabled. The simDetector was generating about 680 frames/s in mono mode and about 190 frames/s in RGB1 mode. The plugin was thus always dropping frames except when the transformation was None in mono and RGB1 mode, and when the transformation was Rot180Mirror in mono mode.

Performance (frames/s)
Dimensions Transformation 8-bit Mono 8-bit RGB1
1024 x 1024 None 680 190
1024 x 1024 Rot90 115 40
1024 x 1024 Rot180 145 52
1024 x 1024 Rot270 105 41
1024 x 1024 Mirror 152 56
1024 x 1024 Rot90Mirror 116 40
1024 x 1024 Rot180Mirror 680 75
1024 x 1024 Rot270Mirror 111 41

Note that this performance with ADCore R2-1 and later is dramatically improved from R2-0 and earlier. For example, in R2-0 with 1024 x 1024 8-bit mono images the frame rate for all transformations (including None) was only 8 frames/s. With 8-bit RGB1 the frame rate for all transformations was only 3 frames/s. Thus, R2-1 improves the performance by a factor of 13-85 compared to previous versions.