CFEL - ASG Software Suite  2.5.0
CASS
Public Types | Public Member Functions | Protected Attributes | List of all members
cass::pp210 Class Reference

#include <hitfinder.h>

+ Inheritance diagram for cass::pp210:
+ Collaboration diagram for cass::pp210:

Public Types

enum  ColumnNames {
  Intensity = 0, centroidColumn = 1, centroidRow = 2, nbrOfPixels = 3,
  SignalToNoiseHighestPixel = 4, Index = 5, Column = 6, Row = 7,
  LocalBackground = 8, LocalBackgroundDeviation = 9, MaxRadius = 10, MinRadius = 11,
  MaxADU = 12, nUpOutliers = 13, Resolution = 14, SignalToNoiseSpot = 15,
  AdditionalPixels = 16, nbrOf
}
 enum describing the contents of the resulting table More...
 
typedef result_t::storage_t table_t
 definition of the table More...
 
typedef result_t::storage_t::value_type pixelval_t
 define the type of the pixel in image More...
 
typedef CummulativeStatisticsNoOutlier< pixelval_tstat_t
 define the type of statistics used More...
 
typedef int64_t index_t
 define the index in the image More...
 
typedef std::pair< index_t, index_tshape_t
 define the shape of the image More...
 
typedef std::vector< index_tneighbourList_t
 define the list of neighbours More...
 
- Public Types inherited from cass::Processor
typedef std::tr1::shared_ptr< Processorshared_pointer
 a shared pointer of this More...
 
typedef std::string name_t
 define the name type More...
 
typedef std::list< name_tnames_t
 define the list of names More...
 
typedef CachedList::item_type result_t
 define the results More...
 
typedef CachedList::item_sp resultsp_t
 define the shared pointer to the result More...
 

Public Member Functions

 pp210 (const name_t &name)
 constructor More...
 
virtual void loadSettings (size_t)
 load the settings for this processor More...
 
virtual void process (const CASSEvent &, result_t &)
 process event More...
 
- Public Member Functions inherited from cass::Processor
 Processor (const name_t &name)
 constructor More...
 
virtual ~Processor ()
 virtual destructor More...
 
virtual void processEvent (const CASSEvent &event)
 process the event More...
 
virtual const result_tresult (const CASSEvent::id_t eventid=0)
 retrieve a result for a given id. More...
 
virtual void releaseEvent (const CASSEvent &event)
 tell the list that the result for event can be overwritten More...
 
result_t::shared_pointer resultCopy (const uint64_t eventid)
 retrieve histogram for id More...
 
virtual void load ()
 load the general settings More...
 
virtual void aboutToQuit ()
 function that will be called when the processor is about to be deleted More...
 
const names_tdependencies ()
 Define all processors keys a processor depends on. More...
 
void clearDependencies ()
 clear the dependenies More...
 
void clearHistograms ()
 clear the histograms More...
 
virtual void processCommand (std::string command)
 process command in pp More...
 
const name_t name () const
 retrieve the name of this processor More...
 
bool hide () const
 retrieve the hide flag of this processor More...
 
const std::string & comment () const
 retrieve the comment of this processor More...
 

Protected Attributes

shape_t _box
 the size of the box within which the peak should lie More...
 
shared_pointer _imagePP
 processor containing the image to find the bragg peaks in More...
 
shape_t _section
 size of a image section More...
 
shape_t _imageShape
 size of the incomming image More...
 
stat_t::value_type _minSnr
 minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier More...
 
pixelval_t _minNbrSnr
 minimum snr when pixel is an neighbour More...
 
stat_t::count_type _minNbrPixels
 the minimum nbr of pixels in the bragg peak More...
 
neighbourList_t _neighbourOffsets
 the list of offsets to next neighbours More...
 
pixelval_t _threshold
 pixel threshold to be exceeded More...
 
pixelval_t _badPixVal
 pixel value of a bad pixel More...
 
size_t _maxAdditionalPixels
 pixel value of a bad pixel More...
 
- Protected Attributes inherited from cass::Processor
const name_t _name
 the processors name More...
 
bool _hide
 flag to tell whether this pp should be hidden in the dropdown list More...
 
std::string _comment
 optional comment that one can add to a processor. More...
 
CachedList _resultList
 the list of results More...
 
names_t _dependencies
 the list of dependencies More...
 
shared_pointer _condition
 pointer to the processor that will contain the condition More...
 

Additional Inherited Members

- Protected Member Functions inherited from cass::Processor
virtual void createHistList (result_t::shared_pointer result)
 create result list. More...
 
void setupGeneral ()
 general setup of the processor More...
 
bool setupCondition (bool defaultConditionType=true)
 setup the condition. More...
 
shared_pointer setupDependency (const std::string &depVarName, const name_t &name="")
 setup the dependecy. More...
 

Detailed Description

Definition at line 708 of file hitfinder.h.

Member Typedef Documentation

typedef int64_t cass::pp210::index_t

define the index in the image

Definition at line 730 of file hitfinder.h.

typedef std::vector<index_t> cass::pp210::neighbourList_t

define the list of neighbours

Definition at line 736 of file hitfinder.h.

typedef result_t::storage_t::value_type cass::pp210::pixelval_t

define the type of the pixel in image

Definition at line 724 of file hitfinder.h.

typedef std::pair<index_t,index_t> cass::pp210::shape_t

define the shape of the image

Definition at line 733 of file hitfinder.h.

define the type of statistics used

Definition at line 727 of file hitfinder.h.

definition of the table

Definition at line 721 of file hitfinder.h.

Member Enumeration Documentation

enum describing the contents of the resulting table

Enumerator
Intensity 
centroidColumn 
centroidRow 
nbrOfPixels 
SignalToNoiseHighestPixel 
Index 
Column 
Row 
LocalBackground 
LocalBackgroundDeviation 
MaxRadius 
MinRadius 
MaxADU 
nUpOutliers 
Resolution 
SignalToNoiseSpot 
AdditionalPixels 
nbrOf 

Definition at line 739 of file hitfinder.h.

Constructor & Destructor Documentation

pp210::pp210 ( const name_t name)

constructor

Definition at line 1382 of file hitfinder.cpp.

References loadSettings().

Member Function Documentation

void pp210::loadSettings ( size_t  )
virtual
void pp210::process ( const CASSEvent evt,
result_t result 
)
virtual

process event

clear the resulting table to fill it with the values of this image

get a table row that we can later add to the table

set up a mask that we can see which pixels have been treated

get iterators to the beginning and end of the image

check if pixel should be treated, when it has been treated before continue with the next pixel

check if pixel is above the threshold, otherwise continue with the next pixel

caluclate where we are within the image

get the right box boundaries, so that we're within the image and the sections

calc the section that the box edges are in

check if pixel is highest within box. If so, check if there are enough pixels that are not outliers. If there are not enough pixels in the box increase the box size and do the checks all over again. If the pixel is not highest within the bigger box continue with the next pixel.

now check if its the highest pixel

check if we're still inside the image

calculate the MAD

check if the median is postive

check if pixel satifies the snr requirement

retrive statistical values from the calculator

from the central pixel look around and see which pixels are direct part of the peak. If a neighbour is found, mask it such that one does not use it twice.

Create a list that should contain the indizes of the pixels that are part of the peak. Go through that list and check for each found neighbour whether it also has a neighbour. If so add it to the list, but only if it is part of the box.

Note
need to check if the pixel has been used after verifiying that the pixel is within the box. Otherwise in rare occasions it will happen that the pixelindex is not within the boolean array which will cause a segfault.

check if the potential neighbour is a bad pixel, if so ignore this bragg spot

if the peak doesn't have enough pixels continue with next pixel

go through all pixels in the box, find out which pixels are part of the peak and centroid them. Mask all pixels in the box as checked so one does not check them again

count how many pixels are not connected to the center one but still above the snr

check how many pixels that are not part of the main peak there are

set the peak's properties and add peak to the list of found peaks

Reimplemented from cass::Processor.

Definition at line 1442 of file hitfinder.cpp.

References _badPixVal, _box, _imagePP, _imageShape, _maxAdditionalPixels, _minNbrPixels, _minNbrSnr, _minSnr, _neighbourOffsets, _section, _threshold, AdditionalPixels, cass::Result< T >::appendRows(), cass::Result< T >::begin(), centroidColumn, centroidRow, Column, cass::Result< T >::end(), cass::CASSEvent::id(), Index, cass::ACQIRIS::integral, Intensity, LocalBackground, LocalBackgroundDeviation, cass::Result< T >::lock, MaxADU, MaxRadius, MinRadius, nbrOf, nbrOfPixels, cass::Result< T >::resetTable(), Row, SignalToNoiseHighestPixel, SignalToNoiseSpot, and cass::Result< T >::size().

Member Data Documentation

pixelval_t cass::pp210::_badPixVal
protected

pixel value of a bad pixel

Definition at line 790 of file hitfinder.h.

Referenced by loadSettings(), and process().

shape_t cass::pp210::_box
protected

the size of the box within which the peak should lie

Definition at line 763 of file hitfinder.h.

Referenced by loadSettings(), and process().

shared_pointer cass::pp210::_imagePP
protected

processor containing the image to find the bragg peaks in

Definition at line 766 of file hitfinder.h.

Referenced by loadSettings(), and process().

shape_t cass::pp210::_imageShape
protected

size of the incomming image

Definition at line 772 of file hitfinder.h.

Referenced by loadSettings(), and process().

size_t cass::pp210::_maxAdditionalPixels
protected

pixel value of a bad pixel

Definition at line 793 of file hitfinder.h.

Referenced by loadSettings(), and process().

stat_t::count_type cass::pp210::_minNbrPixels
protected

the minimum nbr of pixels in the bragg peak

Definition at line 781 of file hitfinder.h.

Referenced by loadSettings(), and process().

pixelval_t cass::pp210::_minNbrSnr
protected

minimum snr when pixel is an neighbour

Definition at line 778 of file hitfinder.h.

Referenced by loadSettings(), and process().

stat_t::value_type cass::pp210::_minSnr
protected

minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier

Definition at line 775 of file hitfinder.h.

Referenced by loadSettings(), and process().

neighbourList_t cass::pp210::_neighbourOffsets
protected

the list of offsets to next neighbours

Definition at line 784 of file hitfinder.h.

Referenced by loadSettings(), and process().

shape_t cass::pp210::_section
protected

size of a image section

Definition at line 769 of file hitfinder.h.

Referenced by loadSettings(), and process().

pixelval_t cass::pp210::_threshold
protected

pixel threshold to be exceeded

Definition at line 787 of file hitfinder.h.

Referenced by loadSettings(), and process().


The documentation for this class was generated from the following files: