SourceXtractorPlusPlus
0.12
Please provide a description of the project.
SEImplementation
src
lib
CheckImages
SourceIdCheckImage.cpp
Go to the documentation of this file.
1
17
/*
18
* SegmentationCheckImage.h
19
*
20
* Created on: Dec 11, 2017
21
* Author: mschefer
22
*/
23
24
#include "
SEImplementation/Property/PixelCoordinateList.h
"
25
#include "
SEImplementation/CheckImages/CheckImages.h
"
26
#include "
SEImplementation/Plugin/SourceIDs/SourceID.h
"
27
28
#include "
SEImplementation/CheckImages/SourceIdCheckImage.h
"
29
30
namespace
SourceXtractor
{
31
32
void
SourceIdCheckImage::handleMessage
(
const
std::shared_ptr<SourceGroupInterface>
& group) {
33
auto
check_image =
CheckImages::getInstance
().
getPartitionImage
();
34
if
(check_image !=
nullptr
) {
35
for
(
auto
& source : *group) {
36
auto
coordinates = source.getProperty<
PixelCoordinateList
>();
37
38
// get the ID for each (multithresholded) source
39
const
auto
& source_id = source.getProperty<
SourceID
>().getId();
40
41
// iterate over the pixels and set the source-id value
42
for
(
auto
& coord : coordinates.getCoordinateList()) {
43
check_image->setValue(coord.m_x, coord.m_y, source_id);
44
}
45
}
46
}
47
}
48
49
}
PixelCoordinateList.h
std::shared_ptr< SourceGroupInterface >
SourceXtractor::CheckImages::getPartitionImage
std::shared_ptr< WriteableImage< unsigned int > > getPartitionImage() const
Definition:
CheckImages.h:62
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
SourceIdCheckImage.h
SourceID.h
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition:
CheckImages.h:136
SourceXtractor::SourceIdCheckImage::handleMessage
virtual void handleMessage(const std::shared_ptr< SourceGroupInterface > &group)
Definition:
SourceIdCheckImage.cpp:32
SourceXtractor::SourceID
Definition:
SourceID.h:33
CheckImages.h
Generated by
1.8.14