SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
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
const
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:160
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
void handleMessage(const SourceInterface &source) override
Definition
DetectionIdCheckImage.cpp:33
SourceXtractor::PixelCoordinateList
Definition
PixelCoordinateList.h:33
SourceXtractor::SourceId
Definition
SourceId.h:32
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition
SourceInterface.h:57
SourceXtractor
Definition
Aperture.h:30
Generated by
1.15.0