SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Background
BackgroundAnalyzerFactory.cpp
Go to the documentation of this file.
1
17
/*
18
* BackgroundAnalyzerFactory.cpp
19
*
20
* Created on: Mar 29, 2017
21
* Author: mschefer
22
*/
23
24
25
#include "
SEImplementation/Background/BackgroundAnalyzerFactory.h
"
26
27
#include "
SEImplementation/Background/SimpleBackgroundAnalyzer.h
"
28
#include "
SEImplementation/Background/SE/SEBackgroundLevelAnalyzer.h
"
29
30
namespace
SourceXtractor
{
31
32
std::shared_ptr<BackgroundAnalyzer>
BackgroundAnalyzerFactory::createBackgroundAnalyzer
()
const
{
33
return
createBackgroundAnalyzer
(
m_weight_type
);
34
}
35
36
std::shared_ptr<BackgroundAnalyzer>
BackgroundAnalyzerFactory::createBackgroundAnalyzer
(
37
WeightImageConfig::WeightType
weight_type)
const
{
38
// make a SE2 background if cell size and smoothing box are given
39
if
(
m_cell_size
.size() > 0 &&
m_smoothing_box
.size() > 0) {
40
return
std::make_shared<SEBackgroundLevelAnalyzer>
(
m_cell_size
,
m_smoothing_box
, weight_type);
41
}
else
{
42
// make a simple background
43
return
std::make_shared<SimpleBackgroundAnalyzer>
();
44
}
45
}
46
47
BackgroundAnalyzerFactory::BackgroundAnalyzerFactory
(
long
manager_id)
48
:
Configuration
(manager_id),
m_weight_type
(
WeightImageConfig
::WeightType::WEIGHT_TYPE_NONE) {
49
declareDependency<SE2BackgroundConfig>
();
50
declareDependency<WeightImageConfig>
();
51
}
52
53
void
BackgroundAnalyzerFactory::initialize
(
const
UserValues
&) {
54
auto
se2background_config =
getDependency<SE2BackgroundConfig>
();
55
auto
weight_image_config =
getDependency<WeightImageConfig>
();
56
m_cell_size
= se2background_config.getCellSize();
57
m_smoothing_box
= se2background_config.getSmoothingBox();
58
m_weight_type
= weight_image_config.getWeightType();
59
}
60
61
}
BackgroundAnalyzerFactory.h
SEBackgroundLevelAnalyzer.h
SimpleBackgroundAnalyzer.h
Euclid::Configuration::Configuration::declareDependency
void declareDependency()
Euclid::Configuration::Configuration::Configuration
Configuration(long manager_id)
Euclid::Configuration::Configuration::UserValues
std::map< std::string, boost::program_options::variable_value > UserValues
Euclid::Configuration::Configuration::getDependency
T & getDependency()
SourceXtractor::BackgroundAnalyzerFactory::m_cell_size
std::vector< int > m_cell_size
Definition
BackgroundAnalyzerFactory.h:49
SourceXtractor::BackgroundAnalyzerFactory::m_smoothing_box
std::vector< int > m_smoothing_box
Definition
BackgroundAnalyzerFactory.h:50
SourceXtractor::BackgroundAnalyzerFactory::m_weight_type
WeightImageConfig::WeightType m_weight_type
Definition
BackgroundAnalyzerFactory.h:51
SourceXtractor::BackgroundAnalyzerFactory::initialize
void initialize(const UserValues &args) override
Definition
BackgroundAnalyzerFactory.cpp:53
SourceXtractor::BackgroundAnalyzerFactory::BackgroundAnalyzerFactory
BackgroundAnalyzerFactory(long manager_id)
Definition
BackgroundAnalyzerFactory.cpp:47
SourceXtractor::BackgroundAnalyzerFactory::createBackgroundAnalyzer
std::shared_ptr< BackgroundAnalyzer > createBackgroundAnalyzer() const
Definition
BackgroundAnalyzerFactory.cpp:32
SourceXtractor::WeightImageConfig
Definition
WeightImageConfig.h:32
SourceXtractor::WeightImageConfig::WeightType
WeightType
Definition
WeightImageConfig.h:36
std::make_shared
T make_shared(T... args)
SourceXtractor
Definition
Aperture.h:30
std::shared_ptr
Generated by
1.15.0