CFEL - ASG Software Suite
2.5.0
CASS
|
#include <hitfinder.h>
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_t > | stat_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_t > | shape_t |
define the shape of the image More... | |
typedef std::vector< index_t > | neighbourList_t |
define the list of neighbours More... | |
![]() | |
typedef std::tr1::shared_ptr< Processor > | shared_pointer |
a shared pointer of this More... | |
typedef std::string | name_t |
define the name type More... | |
typedef std::list< name_t > | names_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... | |
![]() | |
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_t & | result (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_t & | dependencies () |
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... | |
![]() | |
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 | |
![]() | |
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... | |
Definition at line 708 of file hitfinder.h.
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.
enum describing the contents of the resulting table
Definition at line 739 of file hitfinder.h.
pp210::pp210 | ( | const name_t & | name | ) |
|
virtual |
load the settings for this processor
return if any of the dependecies has not been loaded
Create the result output
log what the user was requesting
Reimplemented from cass::Processor.
Definition at line 1388 of file hitfinder.cpp.
References _badPixVal, _box, cass::Processor::_condition, _imagePP, _imageShape, _maxAdditionalPixels, _minNbrPixels, _minNbrSnr, _minSnr, _neighbourOffsets, _section, _threshold, cass::Log::add(), QSettings::beginGroup(), cass::Processor::createHistList(), QString::fromStdString(), cass::Log::INFO, cass::Processor::name(), nbrOf, cass::Processor::setupCondition(), cass::Processor::setupDependency(), cass::Processor::setupGeneral(), and QSettings::value().
Referenced by pp210().
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.
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().
|
protected |
pixel value of a bad pixel
Definition at line 790 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
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().
|
protected |
processor containing the image to find the bragg peaks in
Definition at line 766 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
size of the incomming image
Definition at line 772 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
pixel value of a bad pixel
Definition at line 793 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
the minimum nbr of pixels in the bragg peak
Definition at line 781 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
minimum snr when pixel is an neighbour
Definition at line 778 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
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().
|
protected |
the list of offsets to next neighbours
Definition at line 784 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
size of a image section
Definition at line 769 of file hitfinder.h.
Referenced by loadSettings(), and process().
|
protected |
pixel threshold to be exceeded
Definition at line 787 of file hitfinder.h.
Referenced by loadSettings(), and process().