SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
31namespace 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}
static CheckImages & getInstance()
std::shared_ptr< WriteableImage< int > > getPartitionImage(size_t index) const
Definition CheckImages.h:64
Defines the interface used to group sources.
virtual const_iterator cbegin() const =0
void handleMessage(const SourceGroupInterface &group) override