SourceXtractorPlusPlus  0.13
Please provide a description of the project.
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 
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 
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::PeakValueTask::~PeakValueTask
virtual ~PeakValueTask()=default
SourceXtractor::PeakValueTask::computeProperties
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition: PeakValueTask.h:39
SourceXtractor::Image< SeFloat >::PixelType
SeFloat PixelType
Definition: Image.h:47
PeakValue.h
DetectionFramePixelValues.h
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::PeakValue
Definition: PeakValue.h:32
std::numeric_limits::min
T min(T... args)
SourceXtractor::PeakValueTask
Definition: PeakValueTask.h:33
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition: SourceTask.h:36
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::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
std::numeric_limits::max
T max(T... args)
SourceTask.h
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition: SourceInterface.h:72