SourceXtractorPlusPlus
0.12
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
SEImplementation
Plugin
PeakValue
PeakValueTask.h
Go to the documentation of this file.
1
17
/*
18
* PeakValueTask.h
19
*
20
* Created on: Feb 9, 2017
21
* Author: mschefer
22
*/
23
24
#ifndef _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_
25
#define _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_
26
27
#include "
SEFramework/Task/SourceTask.h
"
28
#include "
SEImplementation/Plugin/PeakValue/PeakValue.h
"
29
#include "
SEImplementation/Plugin/DetectionFramePixelValues/DetectionFramePixelValues.h
"
30
31
namespace
SourceXtractor {
32
33
class
PeakValueTask
:
public
SourceTask
{
34
35
public
:
36
37
virtual
~PeakValueTask
() =
default
;
38
39
virtual
void
computeProperties
(
SourceInterface
& source)
const override
{
40
// FIXME is it correct to use filtered values?
41
const
auto
& pixel_values = source.
getProperty
<
DetectionFramePixelValues
>().getFilteredValues();
42
43
DetectionImage::PixelType
peak_value =
std::numeric_limits<DetectionImage::PixelType>::min
();
44
DetectionImage::PixelType
min_value =
std::numeric_limits<DetectionImage::PixelType>::max
();
45
for
(
auto
value : pixel_values) {
46
peak_value =
std::max
(peak_value, value);
47
min_value =
std::min
(min_value, value);
48
}
49
50
source.
setProperty
<
PeakValue
>(min_value, peak_value);
51
}
52
53
54
private
:
55
56
};
57
58
59
}
/* namespace SourceXtractor */
60
61
62
#endif
/* _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_ */
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
SourceXtractor::Image::PixelType
T PixelType
Definition:
Image.h:47
SourceXtractor::PeakValueTask
Definition:
PeakValueTask.h:33
PeakValue.h
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition:
SourceTask.h:36
SourceTask.h
std::numeric_limits::min
T min(T...args)
SourceXtractor::SourceInterface::setProperty
void setProperty(Args...args)
Definition:
SourceInterface.h:72
SourceXtractor::PeakValueTask::computeProperties
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition:
PeakValueTask.h:39
std::numeric_limits::max
T max(T...args)
DetectionFramePixelValues.h
SourceXtractor::PeakValue
Definition:
PeakValue.h:32
SourceXtractor::DetectionFramePixelValues
The values of a Source's pixels in the detection image. They are returned as a vector in the same ord...
Definition:
DetectionFramePixelValues.h:39
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
SourceXtractor::PeakValueTask::~PeakValueTask
virtual ~PeakValueTask()=default
Generated by
1.8.5