SourceXtractorPlusPlus
0.11
Please provide a description of the project.
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
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
#include "
SEImplementation/Background/SE2/SE2BackgroundLevelAnalyzer.h
"
30
31
namespace
SourceXtractor {
32
33
std::shared_ptr<BackgroundAnalyzer>
BackgroundAnalyzerFactory::createBackgroundAnalyzer
()
const
{
34
return
createBackgroundAnalyzer
(
m_weight_type
);
35
}
36
37
std::shared_ptr<BackgroundAnalyzer>
BackgroundAnalyzerFactory::createBackgroundAnalyzer
(
38
WeightImageConfig::WeightType
weight_type)
const
{
39
// make a SE2 background if cell size and smoothing box are given
40
if
(
m_cell_size
.
size
() > 0 &&
m_smoothing_box
.
size
() > 0) {
41
if
(
m_legacy
)
42
return
std::make_shared<SE2BackgroundLevelAnalyzer>(
m_cell_size
,
m_smoothing_box
, weight_type);
43
else
44
return
std::make_shared<SEBackgroundLevelAnalyzer>(
m_cell_size
,
m_smoothing_box
, weight_type);
45
}
else
{
46
// make a simple background
47
return
std::make_shared<SimpleBackgroundAnalyzer>();
48
}
49
}
50
51
void
BackgroundAnalyzerFactory::reportConfigDependencies
(
Euclid::Configuration::ConfigManager
& manager)
const
{
52
manager.
registerConfiguration
<
SE2BackgroundConfig
>();
53
manager.
registerConfiguration
<
WeightImageConfig
>();
54
}
55
56
void
BackgroundAnalyzerFactory::configure
(
Euclid::Configuration::ConfigManager
& manager) {
57
auto
se2background_config = manager.
getConfiguration
<
SE2BackgroundConfig
>();
58
auto
weight_image_config = manager.
getConfiguration
<
WeightImageConfig
>();
59
m_cell_size
= se2background_config.getCellSize();
60
m_smoothing_box
= se2background_config.getSmoothingBox();
61
m_legacy
= se2background_config.useLegacy();
62
m_weight_type
= weight_image_config.getWeightType();
63
}
64
65
}
SE2BackgroundLevelAnalyzer.h
std::shared_ptr
SourceXtractor::SE2BackgroundConfig
Definition:
SE2BackgroundConfig.h:30
SourceXtractor::BackgroundAnalyzerFactory::m_weight_type
WeightImageConfig::WeightType m_weight_type
Definition:
BackgroundAnalyzerFactory.h:52
SourceXtractor::BackgroundAnalyzerFactory::m_cell_size
std::vector< int > m_cell_size
Definition:
BackgroundAnalyzerFactory.h:49
SourceXtractor::WeightImageConfig::WeightType
WeightType
Definition:
WeightImageConfig.h:36
Euclid::Configuration::ConfigManager::registerConfiguration
void registerConfiguration()
BackgroundAnalyzerFactory.h
SourceXtractor::BackgroundAnalyzerFactory::configure
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition:
BackgroundAnalyzerFactory.cpp:56
Euclid::Configuration::ConfigManager
SimpleBackgroundAnalyzer.h
Euclid::Configuration::ConfigManager::getConfiguration
T & getConfiguration()
std::vector::size
T size(T...args)
SEBackgroundLevelAnalyzer.h
SourceXtractor::BackgroundAnalyzerFactory::createBackgroundAnalyzer
std::shared_ptr< BackgroundAnalyzer > createBackgroundAnalyzer() const
Definition:
BackgroundAnalyzerFactory.cpp:33
SourceXtractor::BackgroundAnalyzerFactory::m_smoothing_box
std::vector< int > m_smoothing_box
Definition:
BackgroundAnalyzerFactory.h:50
SourceXtractor::BackgroundAnalyzerFactory::reportConfigDependencies
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition:
BackgroundAnalyzerFactory.cpp:51
SourceXtractor::BackgroundAnalyzerFactory::m_legacy
bool m_legacy
Definition:
BackgroundAnalyzerFactory.h:51
SourceXtractor::WeightImageConfig
Definition:
WeightImageConfig.h:32
Generated by
1.8.5