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

Test image. More...

#include <imaging.h>

+ Inheritance diagram for cass::pp240:
+ Collaboration diagram for cass::pp240:

Public Types

typedef std::pair< int, int > index_t
 define the index type More...
 
typedef std::pair< float, float > indexf_t
 define a floating point version of the index 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

 pp240 (const name_t &)
 constructor. More...
 
virtual const result_tresult (const CASSEvent::id_t)
 overwrite default behaviour and just return the constant More...
 
virtual void releaseEvent (const CASSEvent &)
 overwrite default behaviour don't do anything More...
 
virtual void processEvent (const CASSEvent &)
 overwrite default behaviour don't do anything More...
 
virtual void loadSettings (size_t)
 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...
 
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...
 

Private Member Functions

void circle (result_t &data, CASSSettings &s)
 add a circle to the mask More...
 
void square (result_t &data, CASSSettings &s)
 add a square element to the mask More...
 
void ellipse (result_t &data, CASSSettings &s)
 add a ellipsodial element to the mask More...
 
void ring (result_t &data, CASSSettings &s)
 add a ring More...
 
void triangle (result_t &data, CASSSettings &s)
 add a triangluar element to the mask More...
 

Private Attributes

result_t::shared_pointer _result
 the constant image More...
 

Additional Inherited Members

- Protected Member Functions inherited from cass::Processor
virtual void process (const CASSEvent &event, result_t &result)
 process the event 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 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...
 

Detailed Description

Test image.

Available PostProcessors:
"240": Test image
See also
Processor for a list of all commonly available cass.ini settings.
User definable Parameters:

Processor/%name%/{sizeX}
Width of testimage (default = 1024)

Processor/%name%/{sizeY}
Height of testimage (default = 1024)

Processor/%name%/{FixedValue}
Use a fixed value instead of the product of the column and row index. Default is false

Processor/%name%/{Value}
In case FixedValue is true, this is the value that the image will be filled with. Default is 0

Processor/%name%/Mask/{size}
The number of mask elements that are part of the complete mask. Default is 0.

Processor/%name%/Mask/%index%/{Type}
Name of the mask element. Default is "Unknown", which let the code ignore that element. Possible values are:

Author
Stephan Kassemeyer
Lutz Foucar

Definition at line 58 of file imaging.h.

Member Typedef Documentation

typedef std::pair<int,int> cass::pp240::index_t

define the index type

Definition at line 80 of file imaging.h.

typedef std::pair<float,float> cass::pp240::indexf_t

define a floating point version of the index

Definition at line 83 of file imaging.h.

Constructor & Destructor Documentation

pp240::pp240 ( const name_t name)

constructor.

Definition at line 111 of file imaging.cpp.

References loadSettings().

Member Function Documentation

void pp240::circle ( result_t data,
CASSSettings s 
)
private

add a circle to the mask

goes through the sqare that conatins the cirlce and checks whether the index is covered by the circle. If so the mask at that index will be set to false.

User definable Parameters:

Processor/%name%/Mask/%index%/{CenterX|CenterY}
The center of the circle. Default is 500|500.

Processor/%name%/Mask/%index%/{Radius}
The radius of the circle. Default is 2.

Processor/%name%/Mask/%index%/{Value}
The value that will be set to all the pixels within the mask. Default is 1

Parameters
datathe container containing the mask where the element should be added
sthe settings element to read the mask element parameters from
Author
Nicola Coppola
Lutz Foucar

Definition at line 159 of file imaging.cpp.

References cass::Result< T >::shape(), cass::toOneD(), cass::toString(), QSettings::value(), and cass::ACQIRIS::width.

Referenced by loadSettings().

void pp240::ellipse ( result_t data,
CASSSettings s 
)
private

add a ellipsodial element to the mask

adds an ellipsodial to the mask. Will iterate trhough the sqare that contains the ellipse and checks which pixels should be masked.

User definable Parameters:

Processor/%name%/Mask/%index%/{CenterX|CenterY}
The central point of the ellipse. Default is 500|500.

Processor/%name%/Mask/%index%/{SemiAxisX|SemiAxisY}
The semi axis along x and y of the ellipse. By definition the longer one defines the major axis and the smaller on the minor axis. Default is 5|4.

Processor/%name%/Mask/%index%/{Value}
The value that will be set to all the pixels within the mask. Default is 1

Parameters
datathe container containing the mask where the element should be added
sthe settings element to read the mask element parameters from
Author
Nicola Coppola
Lutz Foucar
Todo:
check whether this works

Definition at line 226 of file imaging.cpp.

References cass::Result< T >::shape(), cass::toOneD(), cass::toString(), QSettings::value(), and cass::ACQIRIS::width.

Referenced by loadSettings().

void pp240::loadSettings ( size_t  )
virtual
virtual void cass::pp240::processEvent ( const CASSEvent )
inlinevirtual

overwrite default behaviour don't do anything

Reimplemented from cass::Processor.

Definition at line 74 of file imaging.h.

virtual void cass::pp240::releaseEvent ( const CASSEvent )
inlinevirtual

overwrite default behaviour don't do anything

Reimplemented from cass::Processor.

Definition at line 71 of file imaging.h.

virtual const result_t& cass::pp240::result ( const CASSEvent::id_t  )
inlinevirtual

overwrite default behaviour and just return the constant

Reimplemented from cass::Processor.

Definition at line 65 of file imaging.h.

References _result.

void pp240::ring ( result_t data,
CASSSettings s 
)
private

add a ring

define the ring by two ellipses; an inner and outer ellipse. The area covered by the out but not by the inner will be masked. The two ellipsoids can have different centers and axis. Therefore the ring can take any shape.

User definable Parameters:

Processor/%name%/Mask/%index%/{InnerCenterX|InnerCenterY}
The central point of the inner ellipse. Default is 500|500.

Processor/%name%/Mask/%index%/{InnerSemiAxisX|InnerSemiAxisY}
The semi axis along x and y of the inner ellipse. By definition the longer one defines the major axis and the smaller on the minor axis. Default is 5|4.

Processor/%name%/Mask/%index%/{OuterCenterX|OuterCenterY}
The central point of the outer ellipse. Default is 500|500.

Processor/%name%/Mask/%index%/{OuterSemiAxisX|OuterSemiAxisY}
The semi axis along x and y of the outer ellipse. By definition the longer one defines the major axis and the smaller on the minor axis. Default is 20|20.

Processor/%name%/Mask/%index%/{Value}
The value that will be set to all the pixels within the mask. Default is 1

Author
Lutz Foucar

Definition at line 267 of file imaging.cpp.

References cass::Result< T >::shape(), cass::toOneD(), cass::toString(), QSettings::value(), and cass::ACQIRIS::width.

Referenced by loadSettings().

void pp240::square ( result_t data,
CASSSettings s 
)
private

add a square element to the mask

sets all pixels covered by the square to 0.

User definable Parameters:

Processor/%name%/Mask/%index%/{LowerLeftX|LowerLeftY}
The lower left pixel of the square element. The indizes given are included in the square. Default is 0|0.

Processor/%name%/Mask/%index%/{UpperRightX|UpperRightY}
The upper right pixel of the square element. The indizes given are included in the square. Default is 1023|1023.

Processor/%name%/Mask/%index%/{Value}
The value that will be set to all the pixels within the mask. Default is 1

Parameters
datathe container containing the mask where the element should be added
sthe settings element to read the mask element parameters from
Author
Nicola Coppola
Lutz Foucar

Definition at line 192 of file imaging.cpp.

References cass::Result< T >::shape(), cass::toOneD(), cass::toString(), QSettings::value(), and cass::ACQIRIS::width.

Referenced by loadSettings().

void pp240::triangle ( result_t data,
CASSSettings s 
)
private

add a triangluar element to the mask

To see whether a point is within a triangle one can use barycentric coordinates. See http://en.wikipedia.org/wiki/Barycentric_coordinates_(mathematics) for details. A point within barycentric can be defined by converting to these coordinates. The bayrocentric coordinates are represented by three points A, B, C. Each point can be represented by $ \vec{P} = \lambda_1\vec{A} + \lambda_2\vec{B} + \lambda_3\vec{C}$ where $ \lambda_1, \lambda_2, \lambda_3$ can be determined from $ \vec{P} $ using the components of the triangle points and the wanted point $ \vec{P} = (x,y) ; \vec{A} = (x_1,y_1); \vec{B} = (x_2,y_2); \vec{C} = (x_3,y_3)$ with these definition the following equalities are given:

\begin{eqnarray*} \lambda_1&=&\frac{(y_2-y_3)(x-x_3)+(x_3-x_2)(y-y_3)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}\\ \lambda_2&=&\frac{(y_3-y_1)(x-x_3)+(x_1-x_3)(y-y_3)}{(y_2-y_3)(x_1-x_3)+(x_3-x_2)(y_1-y_3)}\\ \lambda_3&=&1-\lambda_1-\lambda_2 \end{eqnarray*}

With this we know that $ \vec{P} $ lies within the triangluar when

\[ 0 \leq \lambda_i \leq 1 \]

User definable Parameters:

Processor/%name%/Mask/%index%/{PointA_X|PointA_Y}
The triangles first point. Default is 500|500.

Processor/%name%/Mask/%index%/{PointB_X|PointB_Y}
The triangles first point. Default is 500|500.

Processor/%name%/Mask/%index%/{PointC_X|PointC_Y}
The triangles first point. Default is 500|500.

Processor/%name%/Mask/%index%/{Value}
The value that will be set to all the pixels within the mask. Default is 1

Parameters
datathe container containing the mask where the element should be added
sthe settings element to read the mask element parameters from
Author
Lutz Foucar

Definition at line 344 of file imaging.cpp.

References A, cass::Result< T >::shape(), cass::toOneD(), cass::toString(), QSettings::value(), cass::ACQIRIS::width, cass::ACQIRIS::x, and cass::ACQIRIS::y.

Referenced by loadSettings().

Member Data Documentation

result_t::shared_pointer cass::pp240::_result
private

the constant image

Definition at line 216 of file imaging.h.

Referenced by loadSettings(), and result().


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