SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
33namespace 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
static CheckImages & getInstance()
void handleMessage(const SourceGroupInterface &group) override
Defines the interface used to group sources.
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
virtual const_iterator cbegin() const =0