SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GroupIdCheckImage.cpp
Go to the documentation of this file.
1 
17 /*
18  * GroupIdCheckImage.cpp
19  *
20  * Created on: 2019 M01 30
21  * Author: mschefer
22  */
23 
25 
30 
32 
33 namespace SourceXtractor {
34 
36  auto hdu_index = group.cbegin()->getProperty<DetectionFrameInfo>().getHduIndex();
37  auto check_image = CheckImages::getInstance().getGroupImage(hdu_index);
38  if (check_image) {
39  // get the ID of the group
40  auto group_id = group.getProperty<GroupInfo>().getGroupId();
41 
42  for (auto& source : group) {
43  auto& coordinates = source.getProperty<PixelCoordinateList>();
44 
45  // iterate over the pixels and set the group_id value
46  for (auto& coord : coordinates.getCoordinateList()) {
47  check_image->setValue(coord.m_x, coord.m_y, group_id);
48  }
49  }
50  }
51 }
52 
53 }
54 
std::shared_ptr< WriteableImage< int > > getGroupImage(size_t index) const
Definition: CheckImages.h:74
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
static CheckImages & getInstance()
Definition: CheckImages.h:150
void handleMessage(const SourceGroupInterface &group) override
virtual const_iterator cbegin() const =0
Defines the interface used to group sources.