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

convert cspad data into laboratory frame using crystfel geometry files More...

#include <image_manipulation.h>

+ Inheritance diagram for cass::pp1602:
+ Collaboration diagram for cass::pp1602:

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_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 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< 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...
 

Detailed Description

convert cspad data into laboratory frame using crystfel geometry files

Available PostProcessors:
"1602": convert cspad data into labframe with geom file

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)

See also
Processor for a list of all commonly available cass.ini settings.
User definable Parameters:

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}

Author
Lutz Foucar

Definition at line 479 of file image_manipulation.h.

Constructor & Destructor Documentation

pp1602::pp1602 ( const name_t name)

constructor

Definition at line 471 of file image_manipulation.cpp.

References loadSettings().

Member Function Documentation

void pp1602::loadSettings ( size_t  unused)
virtual
void pp1602::process ( const CASSEvent evt,
result_t destImage 
)
virtual

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.

void pp1602::setup ( const result_t srcImageHist)
protected

Member Data Documentation

float cass::pp1602::_backgroundValue
protected

the value with wich the background should be filled

Definition at line 508 of file image_manipulation.h.

Referenced by loadSettings(), and process().

bool cass::pp1602::_convertCheetahToCASSLayout
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().

std::string cass::pp1602::_filename
protected

filename of the geometry file

Definition at line 511 of file image_manipulation.h.

Referenced by loadSettings(), and setup().

shared_pointer cass::pp1602::_imagePP
protected

pp containing 2d histogram

Definition at line 499 of file image_manipulation.h.

Referenced by loadSettings(), process(), and setup().

GeometryInfo::lookupTable_t cass::pp1602::_lookupTable
protected

the lookup table

Definition at line 502 of file image_manipulation.h.

Referenced by process(), and setup().


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