CFEL - ASG Software Suite
2.5.0
CASS
|
Create a radial average of q values from a raw detector image. More...
#include <image_manipulation.h>
Classes | |
struct | temp_t |
define the table row of a single output More... | |
Public Member Functions | |
pp90 (const name_t &) | |
constructor More... | |
virtual void | process (const CASSEvent &evt, result_t &) |
process event More... | |
virtual void | loadSettings (size_t unused) |
load the settings of this pp 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 Types | |
typedef std::vector< temp_t > | tempArray_t |
define the matrix More... | |
typedef std::vector< result_t::value_t > | normfactors_t |
define the normalization factors More... | |
Protected Member Functions | |
double | wlFromConstant (const CASSEvent::id_t &) |
retrieve the constant wavelength More... | |
double | wlFromProcessor (const CASSEvent::id_t &id) |
retrieve the wavelength from the processor More... | |
double | ddFromConstant (const CASSEvent::id_t &) |
retrieve the constant detector distance More... | |
double | ddFromProcessor (const CASSEvent::id_t &id) |
retrieve the detector distance from the processor More... | |
temp_t | Q (const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos) |
get the bin when the q-value of the pixel is asked More... | |
temp_t | R (const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos) |
get the bin when the resolution value of the pixel is asked More... | |
temp_t | Rad (const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos) |
get the bin when the radius of the pixel is asked More... | |
![]() | |
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... | |
Protected Attributes | |
shared_pointer | _imagePP |
pp containing 2d histogram More... | |
bool | _convertCheetahToCASSLayout |
flag whether to convert the positions in the src from cheetah to cass layout More... | |
std::string | _filename |
filename of the geometry file More... | |
GeometryInfo::conversion_t | _pixPositions_m |
the pixel positions More... | |
double | _wavelength |
the wavelength in case its fixed More... | |
shared_pointer | _wavelengthPP |
pp containing wavelength in case its not fixed More... | |
std::tr1::function< double(const CASSEvent::id_t &)> | _getWavelength |
function that gets the wavelength More... | |
double | _detdist |
the detector distance in case its fixed More... | |
shared_pointer | _detdistPP |
pp containing detector distance in case its not fixed More... | |
std::tr1::function< double(const CASSEvent::id_t &)> | _getDetectorDistance |
function that gets the detectordistance More... | |
double | _np_m |
the size of one pixel in m More... | |
float | _badPixVal |
value of the bad pixels More... | |
std::tr1::function< temp_t(const double, const double, const result_t::value_t &, const GeometryInfo::pos_t &)> | _getBin |
function to map the pixel to histogram bin, value and fill flag More... | |
result_t::axe_t | _axis |
the axis of the result 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 | |
![]() | |
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... | |
Create a radial average of q values from a raw detector image.
calculate the Q value for each Pixel using the geom file.
Processor/%name%/{ImageName}
the processor name that contains the histogram containing the cspad image in cass layout. Default is "".
Processor/%name%/{GeometryFilename}
The geom file to use. Default is "cspad.geom".
Processor/%name%/{ConvertCheetahToCASSLayout}
Set this true if the geom file is for a cheetah layout of the data, but the image in ImageName is the image in CASS layout.
Processor/%name%/{Wavelength_A}
The wavelength in Angstroem. Can also be the name of a PP that contains the Wavelength. Default is 1.
Processor/%name%/{DetectorDistance_m}
The detector distance in m. Can also be the name of a PP that contains the detector distance. Default is 60e-2.
Processor/%name%/{PixelSize_m}
The pixel size in m. Default is 110e-6
Processor/%name%/{XNbrBins|XLow|XUp}
properties of the resulting 1D histogram
Processor/%name%/{BadPixelValue}
value of the bad pixel in the image. Default is 0
Processor/%name%/{Output}
One can choose the type of radial average that one wants to have. Default is "Q". Possible values are:
Definition at line 567 of file image_manipulation.h.
|
protected |
define the normalization factors
Definition at line 674 of file image_manipulation.h.
|
protected |
define the matrix
Definition at line 593 of file image_manipulation.h.
pp90::pp90 | ( | const name_t & | name | ) |
|
inlineprotected |
retrieve the constant detector distance
id | unused |
Definition at line 612 of file image_manipulation.h.
References _detdist.
Referenced by loadSettings().
|
protected |
retrieve the detector distance from the processor
id | the id of the event to get the detector distance from |
Definition at line 691 of file image_manipulation.cpp.
References _detdistPP.
Referenced by loadSettings().
|
virtual |
load the settings of this pp
unused | this parameter is not used |
setup the method to be used
use fixed value for wavelength if value can be converted to double, otherwise use the wavelength from the processor
use fixed value for detector distance if value can be converted to double, otherwise use the detector distance from the processor
if the method is radius, assign dummy entries (but non-zero) to the wavelength and detector distance
check if the input processors have the correct type
setup the pixel position map
create the output histogram the storage where to put the normfactors
Reimplemented from cass::Processor.
Definition at line 556 of file image_manipulation.cpp.
References _axis, _badPixVal, cass::Processor::_condition, _convertCheetahToCASSLayout, _detdist, _detdistPP, _filename, _getBin, _getDetectorDistance, _getWavelength, _imagePP, _np_m, _pixPositions_m, _wavelength, _wavelengthPP, cass::Log::add(), cass::Result< T >::axis(), QSettings::beginGroup(), cass::Processor::createHistList(), ddFromConstant(), ddFromProcessor(), QString::fromStdString(), cass::GeometryInfo::generateConversionMap(), cass::Log::INFO, cass::ACQIRIS::method, cass::Processor::name(), Q(), R(), Rad(), cass::Processor::result(), cass::set1DHist(), cass::Processor::setupCondition(), cass::Processor::setupDependency(), cass::Processor::setupGeneral(), cass::toString(), QSettings::value(), wlFromConstant(), wlFromProcessor(), and cass::Result< float >::xAxis.
Referenced by pp90().
process event
Get the input histogram and its memory
get the wavelenth and detector distance and return if they are bad
iterate through the src image and determine the pixels bin in the result only when they are not masked
now put the weights into the correct bins and create the nomralization factors
normalize by the number of fills for each bin
normalize by the number of fills for each bin
Reimplemented from cass::Processor.
Definition at line 779 of file image_manipulation.cpp.
References _getBin, _getDetectorDistance, _getWavelength, _imagePP, _pixPositions_m, cass::Result< T >::begin(), cass::Result< T >::datasize(), cass::fuzzyIsNull(), cass::CASSEvent::id(), and cass::Result< T >::lock.
|
protected |
get the bin when the q-value of the pixel is asked
the q-value will be calculated using formula
with being the wavelength in
,
the radius of the pixel and
the detector distance.
lambda | the wavelength |
D | the detector distance |
pixval | the value of the pixel |
pixpos | the position of the pixel in m |
Definition at line 698 of file image_manipulation.cpp.
References _axis, _badPixVal, cass::histogramming::bin(), cass::pp90::temp_t::bin, cass::pp90::temp_t::fill, cass::fuzzycompare(), cass::pp90::temp_t::weight, cass::GeometryInfo::pos_t::x, and cass::GeometryInfo::pos_t::y.
Referenced by loadSettings(), and R().
|
protected |
get the bin when the resolution value of the pixel is asked
the resultion will be calculated as follows
with being the wavelength in
,
the radius of the pixel and
the detector distance.
lambda | the wavelength |
D | the detector distance |
pixval | the value of the pixel |
pixpos | the position of the pixel in m |
Definition at line 722 of file image_manipulation.cpp.
References _axis, _badPixVal, cass::histogramming::bin(), cass::pp90::temp_t::bin, cass::pp90::temp_t::fill, cass::fuzzycompare(), Q(), cass::pp90::temp_t::weight, cass::GeometryInfo::pos_t::x, and cass::GeometryInfo::pos_t::y.
Referenced by loadSettings().
|
protected |
get the bin when the radius of the pixel is asked
lambda | unused |
D | unused |
pixval | the value of the pixel |
pixpos | the position of the pixel in m |
Definition at line 748 of file image_manipulation.cpp.
References _axis, _badPixVal, cass::histogramming::bin(), cass::pp90::temp_t::bin, cass::pp90::temp_t::fill, cass::fuzzycompare(), cass::pp90::temp_t::weight, cass::GeometryInfo::pos_t::x, and cass::GeometryInfo::pos_t::y.
Referenced by loadSettings().
|
inlineprotected |
retrieve the constant wavelength
id | unused |
Definition at line 600 of file image_manipulation.h.
References _wavelength.
Referenced by loadSettings().
|
protected |
retrieve the wavelength from the processor
id | the id of the event to get the wavelength from |
Definition at line 684 of file image_manipulation.cpp.
References _wavelengthPP.
Referenced by loadSettings().
|
protected |
the axis of the result
Definition at line 714 of file image_manipulation.h.
Referenced by loadSettings(), Q(), R(), and Rad().
|
protected |
value of the bad pixels
Definition at line 707 of file image_manipulation.h.
Referenced by loadSettings(), Q(), R(), and Rad().
|
protected |
flag whether to convert the positions in the src from cheetah to cass layout
Definition at line 677 of file image_manipulation.h.
Referenced by loadSettings().
|
protected |
the detector distance in case its fixed
Definition at line 695 of file image_manipulation.h.
Referenced by ddFromConstant(), and loadSettings().
|
protected |
pp containing detector distance in case its not fixed
Definition at line 698 of file image_manipulation.h.
Referenced by ddFromProcessor(), and loadSettings().
|
protected |
filename of the geometry file
Definition at line 680 of file image_manipulation.h.
Referenced by loadSettings().
|
protected |
function to map the pixel to histogram bin, value and fill flag
Definition at line 711 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
function that gets the detectordistance
Definition at line 701 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
function that gets the wavelength
Definition at line 692 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
pp containing 2d histogram
Definition at line 671 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
the size of one pixel in m
Definition at line 704 of file image_manipulation.h.
Referenced by loadSettings().
|
protected |
the pixel positions
Definition at line 683 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
the wavelength in case its fixed
Definition at line 686 of file image_manipulation.h.
Referenced by loadSettings(), and wlFromConstant().
|
protected |
pp containing wavelength in case its not fixed
Definition at line 689 of file image_manipulation.h.
Referenced by loadSettings(), and wlFromProcessor().