RoiCounter

The Region-of-Interest to Counter operation is very useful to provide online statistics on some detector areas. The operation will calculate for each image acquired the average, the standard deviation, the sum, the minimum and the maximum pixel values.

The Roi can be defined either with rectangle coordinates (x begin,y begin, width, height) or with arc coordinates (center x, center y, radius1, radius2, angle start, angle end). Different commands are provided for that purpose: setRois and setArcRois.

You must create first the Rois by providing unique names (addNames command) and then set the Roi position using the Roi index and the position (rectangle or arc position).

The statistics can be retrieved by calling the readCounters command, the command returns a list of statistics per Roi and frame.

In addition to the statistics calculation you can provide a mask file (setMask command or MaskFile property/attribute) where null pixel will not be taken into account.

If you have a detector with pixels which randomly return wrong high count rate, you can use the OverflowThreshold attribute to cut off those defective pixels.

Properties

Property name

Mandatory

Default value

Description

BufferSize

No

128

Circular buffer size in image

MaskFile

No

“”

A mask file

Attributes

Attribute name

RW

Type

Description

BufferSize

rw

DevLong

Circular buffer size in image, default is 128

CounterStatus

ro

DevLong

Counter related to the current number of proceeded images

MaskFile

rw

DevString

The mask file

OverflowThreshold

rw

DevLong

cut off pixels above the threshold value

RunLevel

rw

DevLong

Run level in the processing chain, from 0 to N

State

ro

State

OFF or ON (stopped or started)

Status

ro

DevString

“OFF” “ON” (stopped or started)

Commands

Command name

Arg. in

Arg. out

Description

addNames

DevVarStringArray list of Roi names

DevVarStringArray list of Roi indexes

Set the names and return the corresponding indexes

clearAllRois

DevVoid

DevVoid

Remove the Rois

getNames

DevVoid

DevVarStringArray

Return the list of Roi names

getRoiModes

DevVarStringArray

DevVarStringArray

Return the Roi modes

getRois

DevVarStringArray list of Roi names

DevVarStringArray list of Roi position (roi_id,x,y,width,heigth,…)

Return the Roi positions

getArcRois

DevVarStringArray list of ArcRoi names

DevVarStringArray

list of ArcRoi position

(roi_id,x,y,width,heigth,…)

Return the ArcRoi positions

Init

DevVoid

DevVoid

Do not use

readCounters

DevVarLongArray

DevVarLongArray

removeRois

roi_id,first image

spectrum stack

Return the stack of spectrum from the specified image index until the last image acquired

setArcRois

DevVarDoublArray (roi_id0,centerx,centery, radius1,raduis2,start_angle, end_angle,roi_id1,…)

DevVoid

Set the Arc Rois

setMaskFile

DevVarStringArray full path file

DevVoid

Set the mask file

setRois

DevArLongArray (roi_id0,x,y,w,h,roi_id1..)

DevVoid

Set roi positions

Start

DevVoid

DevVoid

Start the operation on image

State

DevVoid

DevLong

Return the device state

Status

DevVoid

DevString

Return the device state as a string

Stop

DevVoid

DevVoid

Stop the operation on image