SourceXtractorPlusPlus
0.11
Please provide a description of the project.
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/Property/PixelCoordinateList.h
"
27
#include "
SEImplementation/CheckImages/CheckImages.h
"
28
#include "
SEImplementation/Plugin/GroupInfo/GroupInfo.h
"
29
30
#include "
SEImplementation/CheckImages/GroupIdCheckImage.h
"
31
32
namespace
SourceXtractor
{
33
34
void
GroupIdCheckImage::handleMessage
(
const
std::shared_ptr<SourceGroupInterface>
& group) {
35
if
(
m_check_image
) {
36
// get the ID of the group
37
auto
group_id = group->getProperty<
GroupInfo
>().getGroupId();
38
39
std::lock_guard<std::mutex>
lock
(
CheckImages::getInstance
().m_access_mutex);
40
41
for
(
auto
& source : *group) {
42
auto
& coordinates = source.getProperty<
PixelCoordinateList
>();
43
44
// iterate over the pixels and set the group_id value
45
for
(
auto
& coord : coordinates.getCoordinateList()) {
46
m_check_image
->setValue(coord.m_x, coord.m_y, group_id);
47
}
48
}
49
}
50
}
51
52
}
53
PixelCoordinateList.h
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
std::lock
T lock(T... args)
std::shared_ptr< SourceGroupInterface >
CheckImages.h
SourceGroupInterface.h
std::lock_guard
STL class.
GroupInfo.h
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition:
CheckImages.h:114
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::GroupIdCheckImage::m_check_image
std::shared_ptr< WriteableImage< unsigned int > > m_check_image
Definition:
GroupIdCheckImage.h:42
SourceXtractor::GroupIdCheckImage::handleMessage
virtual void handleMessage(const std::shared_ptr< SourceGroupInterface > &group)
Definition:
GroupIdCheckImage.cpp:34
SourceXtractor::GroupInfo
Definition:
GroupInfo.h:32
GroupIdCheckImage.h
Generated by
1.8.18