SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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/Property/PixelCoordinateList.h
"
29
#include "
SEImplementation/Plugin/PeakValue/PeakValue.h
"
30
#include "
SEImplementation/Plugin/DetectionFramePixelValues/DetectionFramePixelValues.h
"
31
32
namespace
SourceXtractor
{
33
34
class
PeakValueTask
:
public
SourceTask
{
35
36
public
:
37
38
virtual
~PeakValueTask
() =
default
;
39
40
void
computeProperties
(
SourceInterface
&
source
)
const override
{
41
// FIXME is it correct to use filtered values?
42
const
auto
&
pixel_values
=
source
.getProperty<
DetectionFramePixelValues
>().getFilteredValues();
43
44
auto
&
coordinates
=
source
.getProperty<
PixelCoordinateList
>().getCoordinateList();
45
46
DetectionImage::PixelType
peak_value
=
std::numeric_limits<DetectionImage::PixelType>::min
();
47
DetectionImage::PixelType
min_value
=
std::numeric_limits<DetectionImage::PixelType>::max
();
48
49
unsigned
int
index=0;
50
int
peak_value_x
=-1;
51
int
peak_value_y
=-1;
52
for
(
auto
value =
pixel_values
.begin(); value!=
pixel_values
.end(); ++value){
53
//for(unsigned i : indices(pixel_values)) {
54
if
(*value>
peak_value
){
55
peak_value
= *value;
56
peak_value_x
=
coordinates
[index].m_x;
57
peak_value_y
=
coordinates
[index].m_y;
58
}
59
if
(*value<
min_value
)
60
min_value
=*value;
61
index++;
62
}
63
//std::cout << "Value: " << peak_value << "x/y: " << peak_value_x << " " << peak_value_y<< std::endl;
64
source
.setProperty<
PeakValue
>(
min_value
,
peak_value
,
peak_value_x
,
peak_value_y
);
65
}
66
67
68
private
:
69
70
};
71
72
73
}
/* namespace SourceXtractor */
74
75
76
#endif
/* _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_ */
DetectionFramePixelValues.h
PeakValue.h
PixelCoordinateList.h
SourceTask.h
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::PeakValueTask
Definition
PeakValueTask.h:34
SourceXtractor::PeakValueTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
PeakValueTask.h:40
SourceXtractor::PeakValueTask::~PeakValueTask
virtual ~PeakValueTask()=default
SourceXtractor::PeakValue
Definition
PeakValue.h:32
SourceXtractor::PixelCoordinateList
Definition
PixelCoordinateList.h:33
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition
SourceTask.h:36
std::function
std::numeric_limits::max
T max(T... args)
std::numeric_limits::min
T min(T... args)
SourceXtractor
Definition
Aperture.h:30
Generated by
1.10.0