SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SourceIdCheckImage.cpp
Go to the documentation of this file.
1 
17 /*
18  * SegmentationCheckImage.h
19  *
20  * Created on: Dec 11, 2017
21  * Author: mschefer
22  */
23 
28 
30 
31 namespace SourceXtractor {
32 
34  auto hdu_index = group.cbegin()->getProperty<DetectionFrameInfo>().getHduIndex();
35  auto check_image = CheckImages::getInstance().getPartitionImage(hdu_index);
36  if (check_image != nullptr) {
37  for (auto& source : group) {
38  const auto& coordinates = source.getProperty<PixelCoordinateList>();
39 
40  // get the ID for each (multithresholded) source
41  const auto& source_id = source.getProperty<SourceID>().getId();
42 
43  // iterate over the pixels and set the source-id value
44  for (auto& coord : coordinates.getCoordinateList()) {
45  check_image->setValue(coord.m_x, coord.m_y, source_id);
46  }
47  }
48  }
49 }
50 
51 }
void handleMessage(const SourceGroupInterface &group) override
std::shared_ptr< WriteableImage< int > > getPartitionImage(size_t index) const
Definition: CheckImages.h:64
static CheckImages & getInstance()
Definition: CheckImages.h:150
virtual const_iterator cbegin() const =0
Defines the interface used to group sources.