SourceXtractorPlusPlus
0.17
SourceXtractor++, the next generation SExtractor
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/Plugin/DetectionFrameInfo/DetectionFrameInfo.h
"
25
#include "
SEImplementation/Property/PixelCoordinateList.h
"
26
#include "
SEImplementation/CheckImages/CheckImages.h
"
27
#include "
SEImplementation/Property/SourceId.h
"
28
29
#include "
SEImplementation/CheckImages/DetectionIdCheckImage.h
"
30
31
namespace
SourceXtractor
{
32
33
void
DetectionIdCheckImage::handleMessage
(
const
std::shared_ptr<SourceInterface>
& source) {
34
auto
hdu_index = source->getProperty<
DetectionFrameInfo
>().getHduIndex();
35
auto
check_image =
CheckImages::getInstance
().
getSegmentationImage
(hdu_index);
36
if
(check_image !=
nullptr
) {
37
auto
coordinates = source->getProperty<
PixelCoordinateList
>();
38
39
// get the ID for each detected source
40
const
auto
& source_id = source->getProperty<
SourceId
>().getDetectionId();
41
42
// iterate over the pixels and set the detection_id value
43
for
(
auto
& coord : coordinates.getCoordinateList()) {
44
check_image->setValue(coord.m_x, coord.m_y, source_id);
45
}
46
}
47
}
48
49
}
CheckImages.h
DetectionFrameInfo.h
DetectionIdCheckImage.h
PixelCoordinateList.h
SourceId.h
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition:
CheckImages.h:150
SourceXtractor::CheckImages::getSegmentationImage
std::shared_ptr< WriteableImage< int > > getSegmentationImage(size_t index) const
Definition:
CheckImages.h:54
SourceXtractor::DetectionFrameInfo
Definition:
DetectionFrameInfo.h:29
SourceXtractor::DetectionIdCheckImage::handleMessage
virtual void handleMessage(const std::shared_ptr< SourceInterface > &source)
Definition:
DetectionIdCheckImage.cpp:33
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