SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
CheckImages
GroupIdCheckImage.cpp
Go to the documentation of this file.
1
17
/*
18
* GroupIdCheckImage.cpp
19
*
20
* Created on: 2019 M01 30
21
* Author: mschefer
22
*/
23
24
#include "
SEFramework/Source/SourceGroupInterface.h
"
25
26
#include "
SEImplementation/Plugin/DetectionFrameInfo/DetectionFrameInfo.h
"
27
#include "
SEImplementation/Property/PixelCoordinateList.h
"
28
#include "
SEImplementation/CheckImages/CheckImages.h
"
29
#include "
SEImplementation/Plugin/GroupInfo/GroupInfo.h
"
30
31
#include "
SEImplementation/CheckImages/GroupIdCheckImage.h
"
32
33
namespace
SourceXtractor
{
34
35
void
GroupIdCheckImage::handleMessage
(
const
SourceGroupInterface
& group) {
36
auto
hdu_index = group.
cbegin
()->getProperty<
DetectionFrameInfo
>().getHduIndex();
37
auto
check_image =
CheckImages::getInstance
().
getGroupImage
(hdu_index);
38
if
(check_image) {
39
// get the ID of the group
40
auto
group_id = group.
getProperty
<
GroupInfo
>().getGroupId();
41
42
for
(
auto
& source : group) {
43
auto
& coordinates = source.getProperty<
PixelCoordinateList
>();
44
45
// iterate over the pixels and set the group_id value
46
for
(
auto
& coord : coordinates.getCoordinateList()) {
47
check_image->setValue(coord.m_x, coord.m_y, group_id);
48
}
49
}
50
}
51
}
52
53
}
54
CheckImages.h
DetectionFrameInfo.h
GroupIdCheckImage.h
GroupInfo.h
PixelCoordinateList.h
SourceGroupInterface.h
SourceXtractor::CheckImages::getGroupImage
std::shared_ptr< WriteableImage< int > > getGroupImage(size_t index) const
Definition
CheckImages.h:74
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition
CheckImages.h:160
SourceXtractor::DetectionFrameInfo
Definition
DetectionFrameInfo.h:29
SourceXtractor::GroupIdCheckImage::handleMessage
void handleMessage(const SourceGroupInterface &group) override
Definition
GroupIdCheckImage.cpp:35
SourceXtractor::GroupInfo
Definition
GroupInfo.h:32
SourceXtractor::PixelCoordinateList
Definition
PixelCoordinateList.h:33
SourceXtractor::SourceGroupInterface
Defines the interface used to group sources.
Definition
SourceGroupInterface.h:38
SourceXtractor::SourceGroupInterface::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::SourceGroupInterface::cbegin
virtual const_iterator cbegin() const =0
SourceXtractor
Definition
Aperture.h:30
Generated by
1.15.0