CFEL - ASG Software Suite
2.5.0
CASS
|
convert cspad data into laboratory frame using crystfel geometry files More...
#include <image_manipulation.h>
Public Member Functions | |
pp1602 (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... | |
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_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 Member Functions | |
void | setup (const result_t &srcImageHist) |
generate the lookup table by parsing the geom file More... | |
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... | |
Protected Attributes | |
shared_pointer | _imagePP |
pp containing 2d histogram More... | |
GeometryInfo::lookupTable_t | _lookupTable |
the lookup table More... | |
bool | _convertCheetahToCASSLayout |
flag whether to convert the positions in the src from cheetah to cass layout More... | |
float | _backgroundValue |
the value with wich the background should be filled More... | |
std::string | _filename |
filename of the geometry file 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 | |
Public Types inherited from cass::Processor | |
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... | |
convert cspad data into laboratory frame using crystfel geometry files
generates a lookup table of where in the result image will go which pixel
to generate a right handed corrdinate system one has to arrange the tiles that are in the CASS layout as follows:
+-------------+ | 31 | +-------------+ | 30 | +-------------+ | 29 | +-------------+ . . . +-------------+ | 02 | +-------------+ ^ | 01 | | +-------------+ y | 00 | | +-------------+ +---x--->
to the following layout. The gaps in between the different segments are non equi distant!
+---> +---> <---+ +---> +---> +------------ + |+----+ |+----+ +------------ +| |+----+ |+----+ ^| 13 | V| | V| | | 06 |V V| | V| | |+-------------+ | | | | +-------------+ | | | | +---> | | | | | | | | | 10 | | 11 | | 04 | | 05 | | | | | <---+ | | | | +-------------+ | | | | +-------------+| | | | | ^| 12 | | | | | | 07 |V | | | | |+-------------+ +----+ +----+ +-------------+ +----+ +----+ +---> quadrant 1 quadrant 0 +---> +---> <---+ <---+ |+----+ |+----+ +-------------+| +----+ +----+ +-------------+| V| | V| | | 08 |V | | | | | 02 |V | | | | +-------------+ | | | | +-------------+ | | | | | | | | | 14 | | 15 | | 01 | | 00 | | | | | <---+ | | | | <---+ | | | | +-------------+| | | | | +-------------+| | | | | | 09 |V | |^ | |^ | 03 |V +----+ +----+ +-------------+ +----+| +----+| +-------------+ <---+ <---+ . +---> +---> +------------ + |+----+ |+----+ +------------ + +----+ +----+ ^| 19 | V| | V| | ^| 25 | | | | | |+-------------+ | | | | |+-------------+ | | | | +---> | | | | +---> | | | | | 16 | | 17 | | 31 | | 30 | | | | | | | | | +-------------+ | | | | +-------------+ | | | | ^| 18 | | | | | ^| 24 | | |^ | |^ |+-------------+ +----+ +----+ |+-------------+ +----+| +----+| +---> +---> <---+ <---+ quadrant 2 quadrant 3 <---+ +----+ +----+ +-------------+ +----+ +----+ +-------------+| | | | | ^| 23 | | | | | | 28 |V | | | | |+-------------+ | | | | +-------------+ | | | | +---> | | | | | 21 | | 20 | | 27 | | 26 | | | | | | | | | <---+ | | | | +-------------+ | | | | +-------------+| | |^ | |^ ^| 22 | | |^ | |^ | 29 |V +----+| +----+| |+-------------+ +----+| +----+| +-------------+ <---+ <---+ +---> <---+ <---+
One can assume that the geom file doesn't translate from the cass layout shown above, but from the cheetah layout (see cass::pp1600). In this case one has to set the ConvertCheetahToCASSLayout to true (default)
Processor/%name%/{ImageName}
the processor name that contains the histogram containing the cspad image in cass layout. Default is "".
Processor/%name%/{GeometryFilename}
Processor/%name%/{ConvertCheetahToCASSLayout}
Processor/%name%/{BackgroundValue}
Definition at line 479 of file image_manipulation.h.
pp1602::pp1602 | ( | const name_t & | name | ) |
|
virtual |
load the settings of this pp
unused | this parameter is not used |
Reimplemented from cass::Processor.
Definition at line 477 of file image_manipulation.cpp.
References _backgroundValue, _convertCheetahToCASSLayout, _filename, _imagePP, QSettings::beginGroup(), QString::fromStdString(), cass::Processor::name(), setup(), cass::Processor::setupCondition(), cass::Processor::setupDependency(), cass::Processor::setupGeneral(), and QSettings::value().
Referenced by pp1602().
process event
Get the input histogram and its memory
fill the result with the background value
iterate through the src image and put its pixels at the location in the destination that is directed in the lookup table
relfect that only 1 event was processed and release resources
Reimplemented from cass::Processor.
Definition at line 516 of file image_manipulation.cpp.
References _backgroundValue, _imagePP, _lookupTable, cass::Result< T >::begin(), cass::Result< T >::end(), cass::CASSEvent::id(), cass::Result< T >::lock, and cass::GeometryInfo::lookupTable_t::lut.
|
protected |
generate the lookup table by parsing the geom file
Definition at line 495 of file image_manipulation.cpp.
References cass::Processor::_condition, _convertCheetahToCASSLayout, _filename, _imagePP, _lookupTable, cass::Log::add(), cass::Processor::createHistList(), cass::GeometryInfo::generateLookupTable(), cass::Log::INFO, cass::GeometryInfo::lookupTable_t::max, cass::GeometryInfo::lookupTable_t::min, cass::Processor::name(), cass::GeometryInfo::lookupTable_t::nCols, cass::GeometryInfo::lookupTable_t::nRows, cass::Result< T >::shape(), cass::Result< T >::size(), cass::toString(), cass::GeometryInfo::pos_t::x, and cass::GeometryInfo::pos_t::y.
Referenced by loadSettings().
|
protected |
the value with wich the background should be filled
Definition at line 508 of file image_manipulation.h.
Referenced by loadSettings(), and process().
|
protected |
flag whether to convert the positions in the src from cheetah to cass layout
Definition at line 505 of file image_manipulation.h.
Referenced by loadSettings(), and setup().
|
protected |
filename of the geometry file
Definition at line 511 of file image_manipulation.h.
Referenced by loadSettings(), and setup().
|
protected |
pp containing 2d histogram
Definition at line 499 of file image_manipulation.h.
Referenced by loadSettings(), process(), and setup().
|
protected |
the lookup table
Definition at line 502 of file image_manipulation.h.