CFEL - ASG Software Suite
2.5.0
CASS
|
Test image. More...
#include <imaging.h>
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... | |
![]() | |
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 | |
pp240 (const name_t &) | |
constructor. More... | |
virtual const result_t & | result (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... | |
![]() | |
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_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... | |
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 | |
![]() | |
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... | |
![]() | |
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... | |
Test image.
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:
typedef std::pair<int,int> cass::pp240::index_t |
typedef std::pair<float,float> cass::pp240::indexf_t |
pp240::pp240 | ( | const name_t & | name | ) |
|
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.
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
data | the container containing the mask where the element should be added |
s | the settings element to read the mask element parameters from |
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().
|
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.
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
data | the container containing the mask where the element should be added |
s | the settings element to read the mask element parameters from |
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().
|
virtual |
load the settings of this pp
Reimplemented from cass::Processor.
Definition at line 117 of file imaging.cpp.
References _result, cass::Log::add(), QSettings::beginGroup(), QSettings::beginReadArray(), cass::histogramming::bin(), circle(), cass::Log::DEBUG0, ellipse(), QSettings::endArray(), QString::fromStdString(), cass::Log::INFO, cass::Processor::name(), ring(), QSettings::setArrayIndex(), size, square(), cass::toString(), triangle(), QSettings::value(), cass::Result< float >::xAxis, and cass::Result< float >::yAxis.
Referenced by pp240().
|
inlinevirtual |
overwrite default behaviour don't do anything
Reimplemented from cass::Processor.
|
inlinevirtual |
overwrite default behaviour don't do anything
Reimplemented from cass::Processor.
|
inlinevirtual |
overwrite default behaviour and just return the constant
Reimplemented from cass::Processor.
Definition at line 65 of file imaging.h.
References _result.
|
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.
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
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().
|
private |
add a square element to the mask
sets all pixels covered by the square to 0.
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
data | the container containing the mask where the element should be added |
s | the settings element to read the mask element parameters from |
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().
|
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 where
can be determined from
using the components of the triangle points and the wanted point
with these definition the following equalities are given:
With this we know that lies within the triangluar when
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
data | the container containing the mask where the element should be added |
s | the settings element to read the mask element parameters from |
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().
|
private |
the constant image
Definition at line 216 of file imaging.h.
Referenced by loadSettings(), and result().