SourceXtractorPlusPlus  0.15
Please provide a description of the project.
 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 
27 
29 
30 namespace SourceXtractor {
31 
33  auto check_image = CheckImages::getInstance().getSegmentationImage();
34  if (check_image != nullptr) {
35  auto coordinates = source->getProperty<PixelCoordinateList>();
36 
37  // get the ID for each detected source
38  const auto& source_id = source->getProperty<SourceId>().getDetectionId();
39 
40  // iterate over the pixels and set the detection_id value
41  for (auto& coord : coordinates.getCoordinateList()) {
42  check_image->setValue(coord.m_x, coord.m_y, source_id);
43  }
44  }
45 }
46 
47 }
static CheckImages & getInstance()
Definition: CheckImages.h:136
std::shared_ptr< WriteableImage< int > > getSegmentationImage() const
Definition: CheckImages.h:54
virtual void handleMessage(const std::shared_ptr< SourceInterface > &source)