SourceXtractorPlusPlus  0.15
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
26 
30 
31 namespace SourceXtractor {
32 
35 }
36 
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 BackgroundAnalyzerFactory::BackgroundAnalyzerFactory(long manager_id) : Configuration(manager_id), m_legacy(false) {
52  declareDependency<SE2BackgroundConfig>();
53  declareDependency<WeightImageConfig>();
54 }
55 
56 void BackgroundAnalyzerFactory::initialize(const UserValues&) {
57  auto se2background_config = getDependency<SE2BackgroundConfig>();
58  auto weight_image_config = getDependency<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 }
void initialize(const UserValues &args) override
T size(T...args)
std::shared_ptr< BackgroundAnalyzer > createBackgroundAnalyzer() const