SourceXtractorPlusPlus
0.16
Please provide a description of the project.
SEImplementation
src
lib
CheckImages
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
24
#include "
SEImplementation/Property/PixelCoordinateList.h
"
25
#include "
SEImplementation/CheckImages/CheckImages.h
"
26
#include "
SEImplementation/Property/SourceId.h
"
27
28
#include "
SEImplementation/CheckImages/DetectionIdCheckImage.h
"
29
30
namespace
SourceXtractor
{
31
32
void
DetectionIdCheckImage::handleMessage
(
const
std::shared_ptr<SourceInterface>
& source) {
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
}
CheckImages.h
DetectionIdCheckImage.h
PixelCoordinateList.h
SourceId.h
SourceXtractor::CheckImages::getSegmentationImage
std::shared_ptr< WriteableImage< int > > getSegmentationImage() const
Definition:
CheckImages.h:54
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition:
CheckImages.h:138
SourceXtractor::DetectionIdCheckImage::handleMessage
virtual void handleMessage(const std::shared_ptr< SourceInterface > &source)
Definition:
DetectionIdCheckImage.cpp:32
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
SourceXtractor::SourceId
Definition:
SourceId.h:32
SourceXtractor
Definition:
Aperture.h:30
std::shared_ptr
Generated by
1.9.1