SourceXtractorPlusPlus
0.19
SourceXtractor++, the next generation SExtractor
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
}
PixelCoordinateList.h
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::DetectionFrameInfo
Definition:
DetectionFrameInfo.h:29
SourceId.h
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
SourceXtractor::DetectionIdCheckImage::handleMessage
void handleMessage(const SourceInterface &source) override
Definition:
DetectionIdCheckImage.cpp:33
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
DetectionIdCheckImage.h
DetectionFrameInfo.h
SourceXtractor::SourceId
Definition:
SourceId.h:32
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
CheckImages.h
Generated by
1.8.5