SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectionIdCheckImage.cpp
Go to the documentation of this file.
1 
17 /*
18  * DetectionIdCheckImage.cpp
19  *
20  * Created on: Jun 25, 2018
21  * Author: mschefer
22  */
23 
28 
30 
31 namespace SourceXtractor {
32 
34  auto hdu_index = source.getProperty<DetectionFrameInfo>().getHduIndex();
35  auto check_image = CheckImages::getInstance().getSegmentationImage(hdu_index);
36  if (check_image != nullptr) {
37  const auto& coordinates = source.getProperty<PixelCoordinateList>();
38 
39  // get the ID for each detected source
40  const auto& source_id = source.getProperty<SourceId>().getDetectionId();
41 
42  // iterate over the pixels and set the detection_id value
43  for (auto& coord : coordinates.getCoordinateList()) {
44  check_image->setValue(coord.m_x, coord.m_y, source_id);
45  }
46  }
47 }
48 
49 }
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
void handleMessage(const SourceInterface &source) override
static CheckImages & getInstance()
Definition: CheckImages.h:150
std::shared_ptr< WriteableImage< int > > getSegmentationImage(size_t index) const
Definition: CheckImages.h:54
The SourceInterface is an abstract &quot;source&quot; that has properties attached to it.