SourceXtractorPlusPlus  0.16
Please provide a description of the project.
SourceXtractor.cpp
Go to the documentation of this file.
1 
23 #include <dlfcn.h>
24 #include <iomanip>
25 #include <map>
26 #include <string>
27 #include <typeinfo>
28 
29 #include <boost/program_options.hpp>
30 #include <boost/algorithm/string/predicate.hpp>
32 
33 #include "ElementsKernel/Main.h"
34 #include "ElementsKernel/System.h"
36 
38 #include "Configuration/Utils.h"
39 
41 
49 
51 
54 
77 
79 #include "SEMain/PluginConfig.h"
80 #include "SEMain/Sorter.h"
81 
82 
83 namespace po = boost::program_options;
84 namespace fs = boost::filesystem;
85 using namespace SourceXtractor;
86 using namespace Euclid::Configuration;
87 
89 
90 static const std::string LIST_OUTPUT_PROPERTIES {"list-output-properties"};
91 static const std::string PROPERTY_COLUMN_MAPPING_ALL {"property-column-mapping-all"};
92 static const std::string PROPERTY_COLUMN_MAPPING {"property-column-mapping"};
93 static const std::string DUMP_CONFIG {"dump-default-config"};
94 
95 class GroupObserver : public Observer<std::shared_ptr<SourceGroupInterface>> {
96 public:
97  virtual void handleMessage(const std::shared_ptr<SourceGroupInterface>& group) override {
98  m_list.push_back(group);
99  }
100 
102 };
103 
104 class SourceObserver : public Observer<std::shared_ptr<SourceWithOnDemandProperties>> {
105 public:
106  virtual void handleMessage(const std::shared_ptr<SourceWithOnDemandProperties>& source) override {
107  m_list.push_back(source);
108  }
109 
111 };
112 
114 
115 static void setupEnvironment(void) {
116  // Some parts of boost (including boost::filesystem) can throw an exception when the
117  // locale as configured in the environment is invalid.
118  // We work around that overriding the locale if we find an invalid one.
119  // See https://svn.boost.org/trac10/ticket/10205
120  try {
121  std::locale("");
122  }
123  catch (...) {
124  ::setenv("LC_ALL", "C", 1);
125  }
126 }
127 
135  bool omp_env_present = getenv("OMP_NUM_THREADS") || getenv("OMP_DYNAMIC");
136  bool mkl_env_present = getenv("MKL_NUM_THREADS") || getenv("MKL_DYNAMIC");
137  if (!omp_env_present && !mkl_env_present) {
138  // Despite the documentation, the methods following C ABI are capitalized
139  void (*set_num_threads)(int) = reinterpret_cast<void (*)(int)>(dlsym(RTLD_DEFAULT, "MKL_Set_Num_Threads"));
140  void (*set_dynamic)(int) = reinterpret_cast<void (*)(int)>(dlsym(RTLD_DEFAULT, "MKL_Set_Dynamic"));
141  if (set_num_threads) {
142  logger.debug() << "Disabling multithreading";
143  set_num_threads(1);
144  }
145  if (set_dynamic) {
146  logger.debug() << "Disabling dynamic multithreading";
147  set_dynamic(0);
148  }
149  }
150 }
151 
152 class SEMain : public Elements::Program {
153 
154  std::shared_ptr<TaskFactoryRegistry> task_factory_registry = std::make_shared<TaskFactoryRegistry>();
155  std::shared_ptr<TaskProvider> task_provider = std::make_shared<TaskProvider>(task_factory_registry);
156  std::shared_ptr<OutputRegistry> output_registry = std::make_shared<OutputRegistry>();
157  SegmentationFactory segmentation_factory {task_provider};
158  OutputFactory output_factory { output_registry };
161  std::make_shared<SourceWithOnDemandPropertiesFactory>(task_provider);
163  std::make_shared<SourceGroupWithOnDemandPropertiesFactory>(task_provider);
164  PartitionFactory partition_factory {source_factory};
165  GroupingFactory grouping_factory {group_factory};
166  DeblendingFactory deblending_factory {source_factory};
167  MeasurementFactory measurement_factory { output_registry };
168  ProgressReporterFactory progress_printer_factory {};
169 
170  bool config_initialized = false;
171  po::options_description config_parameters;
172 
173 public:
174 
175  SEMain(const std::string& plugin_path, const std::vector<std::string>& plugin_list)
176  : plugin_manager { task_factory_registry, output_registry, config_manager_id, plugin_path, plugin_list } {
177  }
178 
182  po::options_description getConfigParameters() {
183  if (!config_initialized) {
184  auto& config_manager = ConfigManager::getInstance(config_manager_id);
185  config_manager.registerConfiguration<SourceXtractorConfig>();
186  config_manager.registerConfiguration<BackgroundConfig>();
187  config_manager.registerConfiguration<SE2BackgroundConfig>();
188  config_manager.registerConfiguration<MemoryConfig>();
189  config_manager.registerConfiguration<BackgroundAnalyzerFactory>();
190  config_manager.registerConfiguration<SamplingConfig>();
191 
193 
194  //plugins need to be registered before reportConfigDependencies()
195  plugin_manager.loadPlugins();
196  task_factory_registry->reportConfigDependencies(config_manager);
197  segmentation_factory.reportConfigDependencies(config_manager);
198  partition_factory.reportConfigDependencies(config_manager);
199  grouping_factory.reportConfigDependencies(config_manager);
200  deblending_factory.reportConfigDependencies(config_manager);
201  measurement_factory.reportConfigDependencies(config_manager);
202  output_factory.reportConfigDependencies(config_manager);
203 
204  config_parameters.add(config_manager.closeRegistration());
205  config_initialized = true;
206  }
207  return config_parameters;
208  }
209 
212  auto options = getConfigParameters();
213 
214  options.add_options() (LIST_OUTPUT_PROPERTIES.c_str(), po::bool_switch(),
215  "List the possible output properties for the given input parameters and exit");
216  options.add_options() (PROPERTY_COLUMN_MAPPING_ALL.c_str(), po::bool_switch(),
217  "Show the columns created for each property");
218  options.add_options() (PROPERTY_COLUMN_MAPPING.c_str(), po::bool_switch(),
219  "Show the columns created for each property, for the given configuration");
220  options.add_options() (DUMP_CONFIG.c_str(), po::bool_switch(),
221  "Dump parameters with default values into a configuration file");
222  progress_printer_factory.addOptions(options);
223 
224  // Allow to pass Python options as positional following --
225  po::positional_options_description p;
226  p.add("python-arg", -1);
227 
228  return {options, p};
229  }
230 
232  template <typename T>
233  static void writeDefault(std::ostream& out, const po::option_description& opt, const boost::any& default_value) {
234  out << opt.long_name() << '=' << boost::any_cast<T>(default_value) << std::endl;
235  }
236 
238  template <typename T>
239  static void writeDefaultMultiple(std::ostream& out, const po::option_description& opt, const boost::any& default_value) {
240  auto values = boost::any_cast<std::vector<T>>(default_value);
241  if (values.empty()) {
242  out << "# " << opt.long_name() << '=' << std::endl;
243  }
244  else {
245  for (const auto& v : values)
246  out << opt.long_name() << '=' << v << std::endl;
247  }
248  }
249 
251  void printDefaults() {
252  typedef std::function<void(std::ostream&, const po::option_description&, const boost::any&)> PrinterFunction;
254  {typeid(bool), &writeDefault<bool>},
255  {typeid(int), &writeDefault<int>},
256  {typeid(double), &writeDefault<double>},
257  {typeid(std::string), &writeDefault<std::string>},
258  {typeid(std::vector<std::string>), &writeDefaultMultiple<std::string>}
259  };
260  decltype(printers)::const_iterator printer;
261 
262  auto config_parameters = getConfigParameters();
263  for (const auto& p : config_parameters.options()) {
264  boost::any default_value;
265 
266  std::cout << "# " << p->description() << std::endl;
267  if (!p->semantic()->apply_default(default_value)) {
268  std::cout << '#' << p->long_name() << "=" << std::endl;
269  }
270  else if ((printer = printers.find(default_value.type())) == printers.end()) {
271  std::cout << '#' << p->long_name() << "=<Unknown type " << default_value.type().name() << '>' << std::endl;
272  }
273  else {
274  printer->second(std::cout, *p, default_value);
275  }
276  std::cout << std::endl;
277  }
278 
279  // We need to print the log options manually, as that is set up by Elements
280  std::cout << "# Log level: FATAL, ERROR, WARN, INFO, DEBUG" << std::endl;
281  std::cout << "log-level=INFO" << std::endl;
282  std::cout << "# Log file" << std::endl;
283  std::cout << "#log-file" << std::endl;
284  }
285 
287 
288  // If the user just requested to see the possible output columns we show
289  // them and we do nothing else
290 
291  if (args.at(LIST_OUTPUT_PROPERTIES).as<bool>()) {
292  for (auto& name : output_registry->getOutputPropertyNames()) {
293  std::cout << name << std::endl;
294  }
295  return Elements::ExitCode::OK;
296  }
297 
298  if (args.at(PROPERTY_COLUMN_MAPPING_ALL).as<bool>()) {
299  output_registry->printPropertyColumnMap();
300  return Elements::ExitCode::OK;
301  }
302 
303  if (args.at(DUMP_CONFIG).as<bool>()) {
304  printDefaults();
305  return Elements::ExitCode::OK;
306  }
307 
308  // Make sure the BLAS multithreading does not interfere
310 
311  // Elements does not verify that the config-file exists. It will just not read it.
312  // We verify that it does exist here.
313  if (args.find("config-file") != args.end()) {
314  auto cfg_file = args.at("config-file").as<fs::path>();
315  if (cfg_file != "" && !fs::exists(cfg_file)) {
316  throw Elements::Exception() << "The configuration file '" << cfg_file << "' does not exist";
317  }
318  }
319 
320  // Create the progress listener and printer ASAP
321  progress_printer_factory.configure(args);
322  auto progress_mediator = progress_printer_factory.createProgressMediator();
323 
324  // Initialize the rest of the components
325  auto& config_manager = ConfigManager::getInstance(config_manager_id);
326  config_manager.initialize(args);
327 
328  // Configure TileManager
329  auto memory_config = config_manager.getConfiguration<MemoryConfig>();
330  TileManager::getInstance()->setOptions(memory_config.getTileSize(),
331  memory_config.getTileSize(), memory_config.getTileMaxMemory());
332 
333  CheckImages::getInstance().configure(config_manager);
334 
335  task_factory_registry->configure(config_manager);
336  task_factory_registry->registerPropertyInstances(*output_registry);
337 
338  segmentation_factory.configure(config_manager);
339  partition_factory.configure(config_manager);
340  grouping_factory.configure(config_manager);
341  deblending_factory.configure(config_manager);
342  measurement_factory.configure(config_manager);
343  output_factory.configure(config_manager);
344 
345  if (args.at(PROPERTY_COLUMN_MAPPING).as<bool>()) {
346  output_registry->printPropertyColumnMap(config_manager.getConfiguration<OutputConfig>().getOutputProperties());
347  return Elements::ExitCode::OK;
348  }
349 
350  auto detection_image = config_manager.getConfiguration<DetectionImageConfig>().getDetectionImage();
351  auto detection_image_path = config_manager.getConfiguration<DetectionImageConfig>().getDetectionImagePath();
352  auto weight_image = config_manager.getConfiguration<WeightImageConfig>().getWeightImage();
353  bool is_weight_absolute = config_manager.getConfiguration<WeightImageConfig>().isWeightAbsolute();
354  auto weight_threshold = config_manager.getConfiguration<WeightImageConfig>().getWeightThreshold();
355 
356  auto detection_image_coordinate_system = config_manager.getConfiguration<DetectionImageConfig>().getCoordinateSystem();
357  auto detection_image_gain = config_manager.getConfiguration<DetectionImageConfig>().getGain();
358  auto detection_image_saturation = config_manager.getConfiguration<DetectionImageConfig>().getSaturation();
359 
360  auto segmentation = segmentation_factory.createSegmentation();
361 
362  // Multithreading
363  auto multithreading_config = config_manager.getConfiguration<MultiThreadingConfig>();
364  auto thread_pool = multithreading_config.getThreadPool();
365 
366  // Prefetcher
367  std::shared_ptr<Prefetcher> prefetcher;
368  if (thread_pool) {
369  prefetcher = std::make_shared<Prefetcher>(thread_pool, multithreading_config.getMaxQueueSize());
370  }
371 
372  // Rest of the stagees
373  auto partition = partition_factory.getPartition();
374  auto source_grouping = grouping_factory.createGrouping();
375 
376  std::shared_ptr<Deblending> deblending = deblending_factory.createDeblending();
377  std::shared_ptr<Measurement> measurement = measurement_factory.getMeasurement();
378  std::shared_ptr<Output> output = output_factory.getOutput();
379 
380  if (prefetcher) {
381  prefetcher->requestProperties(source_grouping->requiredProperties());
382  prefetcher->requestProperties(deblending->requiredProperties());
383  }
384 
385  // Link together the pipeline's steps
386  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(partition);
387 
388  if (prefetcher) {
389  segmentation->Observable<ProcessSourcesEvent>::addObserver(prefetcher);
390  prefetcher->Observable<ProcessSourcesEvent>::addObserver(source_grouping);
391  partition->addObserver(prefetcher);
392  prefetcher->Observable<std::shared_ptr<SourceInterface>>::addObserver(source_grouping);
393  }
394  else {
395  segmentation->Observable<ProcessSourcesEvent>::addObserver(source_grouping);
396  partition->addObserver(source_grouping);
397  }
398 
399  source_grouping->addObserver(deblending);
400  deblending->addObserver(measurement);
401 
402  if (config_manager.getConfiguration<OutputConfig>().getOutputUnsorted()) {
403  logger.info() << "Writing output following measure order";
404  measurement->addObserver(output);
405  } else {
406  logger.info() << "Writing output following segmentation order";
407  auto sorter = std::make_shared<Sorter>();
408  measurement->addObserver(sorter);
409  sorter->addObserver(output);
410  }
411 
412  segmentation->Observable<SegmentationProgress>::addObserver(progress_mediator->getSegmentationObserver());
413  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(progress_mediator->getDetectionObserver());
414  deblending->addObserver(progress_mediator->getDeblendingObserver());
415  measurement->addObserver(progress_mediator->getMeasurementObserver());
416 
417  // Add observers for CheckImages
418  if (CheckImages::getInstance().getSegmentationImage() != nullptr) {
419  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(
420  std::make_shared<DetectionIdCheckImage>());
421  }
422  if (CheckImages::getInstance().getPartitionImage() != nullptr) {
423  measurement->addObserver(
424  std::make_shared<SourceIdCheckImage>());
425  }
426  if (CheckImages::getInstance().getGroupImage() != nullptr) {
427  measurement->addObserver(
428  std::make_shared<GroupIdCheckImage>());
429  }
430  if (CheckImages::getInstance().getMoffatImage() != nullptr) {
431  measurement->addObserver(
432  std::make_shared<MoffatCheckImage>());
433  }
434 
435  auto interpolation_gap = config_manager.getConfiguration<DetectionImageConfig>().getInterpolationGap();
436  auto detection_frame = std::make_shared<DetectionImageFrame>(detection_image, weight_image,
437  weight_threshold, detection_image_coordinate_system, detection_image_gain,
438  detection_image_saturation, interpolation_gap);
439  detection_frame->setLabel(boost::filesystem::basename(detection_image_path));
440 
441  auto background_analyzer = config_manager.getConfiguration<BackgroundAnalyzerFactory>().createBackgroundAnalyzer();
442  auto background_model = background_analyzer->analyzeBackground(detection_frame->getOriginalImage(), weight_image,
443  ConstantImage<unsigned char>::create(detection_image->getWidth(), detection_image->getHeight(), false), detection_frame->getVarianceThreshold());
444 
445  // initial set of the variance and background check images, might be overwritten below
446  CheckImages::getInstance().setBackgroundCheckImage(background_model.getLevelMap());
447  CheckImages::getInstance().setVarianceCheckImage(background_model.getVarianceMap());
448 
449  detection_frame->setBackgroundLevel(background_model.getLevelMap(), background_model.getMedianRms());
450 
451  if (weight_image != nullptr) {
452  if (is_weight_absolute) {
453  detection_frame->setVarianceMap(weight_image);
454  } else {
455  auto scaled_image = MultiplyImage<SeFloat>::create(weight_image, background_model.getScalingFactor());
456  detection_frame->setVarianceMap(scaled_image);
457  }
458  } else {
459  detection_frame->setVarianceMap(background_model.getVarianceMap());
460  }
461  // re-set the variance check image to what's in the detection_frame()
462  CheckImages::getInstance().setVarianceCheckImage(detection_frame->getVarianceMap());
463 
464  const auto& background_config = config_manager.getConfiguration<BackgroundConfig>();
465 
466  // Override background level and threshold if requested by the user
467  if (background_config.isBackgroundLevelAbsolute()) {
469  detection_image->getWidth(), detection_image->getHeight(), background_config.getBackgroundLevel());
470 
471  detection_frame->setBackgroundLevel(background, background_model.getMedianRms());
473  }
474 
475  if (background_config.isDetectionThresholdAbsolute()) {
476  detection_frame->setDetectionThreshold(background_config.getDetectionThreshold());
477  }
478  CheckImages::getInstance().setVarianceCheckImage(detection_frame->getVarianceMap());
479 
480  //CheckImages::getInstance().setFilteredCheckImage(detection_frame->getFilteredImage());
481 
482  // Perform measurements (multi-threaded part)
483  measurement->startThreads();
484 
485  try {
486  // Process the image
487  segmentation->processFrame(detection_frame);
488  }
489  catch (const std::exception &e) {
490  logger.error() << "Failed to process the frame! " << e.what();
491  measurement->waitForThreads();
493  }
494 
495  if (prefetcher) {
496  prefetcher->wait();
497  }
498  measurement->waitForThreads();
499 
500  CheckImages::getInstance().setFilteredCheckImage(detection_frame->getFilteredImage());
501  CheckImages::getInstance().setThresholdedCheckImage(detection_frame->getThresholdedImage());
502  CheckImages::getInstance().setSnrCheckImage(detection_frame->getSnrImage());
504  TileManager::getInstance()->flush();
505 
506  size_t n_writen_rows = output->flush();
507 
508  progress_mediator->done();
509 
510  if (n_writen_rows > 0) {
511  logger.info() << n_writen_rows << " sources detected";
512  } else {
513  logger.info() << "NO SOURCES DETECTED";
514  }
515 
516  return Elements::ExitCode::OK;
517  }
518 };
519 
520 
522 
523 public:
525  m_plugin_path(plugin_path), m_plugin_list(plugin_list) {
526  }
527 
528  virtual ~PluginOptionsMain() = default;
529 
530  boost::program_options::options_description defineSpecificProgramOptions() override {
531  auto& config_manager = ConfigManager::getInstance(conf_man_id);
532  config_manager.registerConfiguration<PluginConfig>();
533  auto options = config_manager.closeRegistration();
534  // The following will consume any extra options in the configuration file
535  options.add_options()("*", po::value<std::vector<std::string>>());
536  return options;
537  }
538 
540  auto& config_manager = ConfigManager::getInstance(conf_man_id);
541  config_manager.initialize(args);
542  auto& conf = config_manager.getConfiguration<PluginConfig>();
543  m_plugin_path = conf.getPluginPath();
544  m_plugin_list = conf.getPluginList();
545  return Elements::ExitCode::OK;
546  }
547 
548 private:
549 
550  long conf_man_id = getUniqueManagerId();
553 
554 };
555 
556 
557 static void forwardOptions(int argc, char *const *argv, std::vector<std::string>& plugin_options_input) {
558  for (int i = 0; i < argc; ++i) {
559  std::string option{argv[i]};
560  if (option == "--config-file") {
561  plugin_options_input.emplace_back("--config-file");
562  plugin_options_input.emplace_back(std::string{argv[i + 1]});
563  }
564  if (boost::starts_with(option, "--config-file=")) {
565  plugin_options_input.emplace_back(option);
566  }
567  if (option == "--plugin-directory") {
568  plugin_options_input.emplace_back("--plugin-directory");
569  plugin_options_input.emplace_back(std::string{argv[i + 1]});
570  }
571  if (boost::starts_with(option, "--plugin-directory=")) {
572  plugin_options_input.emplace_back(option);
573  }
574  if (option == "--plugin") {
575  plugin_options_input.emplace_back("--plugin");
576  plugin_options_input.emplace_back(std::string{argv[i + 1]});
577  }
578  if (boost::starts_with(option, "--plugin=")) {
579  plugin_options_input.emplace_back(option);
580  }
581  }
582 }
583 
584 
585 ELEMENTS_API int main(int argc, char* argv[]) {
586  std::string plugin_path {};
587  std::vector<std::string> plugin_list {};
588 
589  // This adds the current directory as a valid location for the default "sourcextractor++.conf" configuration
590  Elements::TempEnv local_env;
591  if (local_env["ELEMENTS_CONF_PATH"].empty()) {
592  local_env["ELEMENTS_CONF_PATH"] = ".:/etc";
593  } else {
594  local_env["ELEMENTS_CONF_PATH"] = ".:" + local_env["ELEMENTS_CONF_PATH"] + ":/etc";
595  }
596 
598 
599  // Try to be reasonably graceful with unhandled exceptions
601 
602  try {
603  // First we create a program which has a sole purpose to get the options for
604  // the plugin paths. Note that we do not want to have this helper program
605  // to handle any other options except of the plugin-directory and plugin, so
606  // we create a subset of the given options with only the necessary ones. We
607  // also turn off the the logging.
608  std::vector<int> masked_indices{};
609  std::vector<std::string> plugin_options_input{};
610  plugin_options_input.emplace_back("DummyProgram");
611  plugin_options_input.emplace_back("--log-level");
612  plugin_options_input.emplace_back("ERROR");
613  forwardOptions(argc, argv, plugin_options_input);
614 
615  int argc_tmp = plugin_options_input.size();
616  std::vector<const char *> argv_tmp(argc_tmp);
617  for (unsigned int i = 0; i < plugin_options_input.size(); ++i) {
618  auto& option_str = plugin_options_input[i];
619  argv_tmp[i] = option_str.data();
620  }
621 
622  CREATE_MANAGER_WITH_ARGS(plugin_options_program, PluginOptionsMain, plugin_path, plugin_list);
623  plugin_options_program.run(argc_tmp, const_cast<char **>(argv_tmp.data()));
624 
625  CREATE_MANAGER_WITH_ARGS(main, SEMain, plugin_path, plugin_list);
626  Elements::ExitCode exit_code = main.run(argc, argv);
627  return static_cast<Elements::ExitCodeType>(exit_code);
628  }
629  catch (const std::exception &e) {
630  logger.fatal() << e.what();
632  }
633  catch (...) {
634  logger.fatal() << "Unknown exception type!";
635  logger.fatal() << "Please, report this as a bug";
637  }
638 }
static const std::string PROPERTY_COLUMN_MAPPING
static void setupEnvironment(void)
static void disableBlasMultithreading()
static const std::string LIST_OUTPUT_PROPERTIES
static void forwardOptions(int argc, char *const *argv, std::vector< std::string > &plugin_options_input)
static const std::string PROPERTY_COLUMN_MAPPING_ALL
static const std::string DUMP_CONFIG
static long config_manager_id
ELEMENTS_API int main(int argc, char *argv[])
T at(T... args)
T c_str(T... args)
static Logging getLogger(const std::string &name="")
static void onTerminate() noexcept
static ConfigManager & getInstance(long id)
virtual void handleMessage(const std::shared_ptr< SourceGroupInterface > &group) override
std::list< std::shared_ptr< SourceGroupInterface > > m_list
boost::program_options::options_description defineSpecificProgramOptions() override
Elements::ExitCode mainMethod(std::map< std::string, boost::program_options::variable_value > &args) override
std::string & m_plugin_path
virtual ~PluginOptionsMain()=default
PluginOptionsMain(std::string &plugin_path, std::vector< std::string > &plugin_list)
std::vector< std::string > & m_plugin_list
po::options_description getConfigParameters()
void printDefaults()
Print a configuration file populated with defaults.
SEMain(const std::string &plugin_path, const std::vector< std::string > &plugin_list)
Elements::ExitCode mainMethod(std::map< std::string, po::variable_value > &args) override
static void writeDefaultMultiple(std::ostream &out, const po::option_description &opt, const boost::any &default_value)
Print a multiple-value option.
std::pair< po::options_description, po::positional_options_description > defineProgramArguments() override
Return the arguments that the program accepts.
static void writeDefault(std::ostream &out, const po::option_description &opt, const boost::any &default_value)
Print a simple option.
PluginManager plugin_manager
po::options_description config_parameters
std::list< std::shared_ptr< SourceWithOnDemandProperties > > m_list
virtual void handleMessage(const std::shared_ptr< SourceWithOnDemandProperties > &source) override
void setVarianceCheckImage(std::shared_ptr< Image< SeFloat >> variance_image)
Definition: CheckImages.h:116
void setBackgroundCheckImage(std::shared_ptr< Image< SeFloat >> background_image)
Definition: CheckImages.h:112
void setSnrCheckImage(std::shared_ptr< Image< SeFloat >> snr_image)
Definition: CheckImages.h:128
virtual void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition: CheckImages.cpp:67
void setThresholdedCheckImage(std::shared_ptr< Image< SeFloat >> thresholded_image)
Definition: CheckImages.h:124
static CheckImages & getInstance()
Definition: CheckImages.h:138
virtual void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition: CheckImages.cpp:40
void setFilteredCheckImage(std::shared_ptr< Image< SeFloat >> filtered_image)
Definition: CheckImages.h:120
static std::shared_ptr< ConstantImage< T > > create(int width, int height, T constant_value)
Definition: ConstantImage.h:42
Provides the detection image.
const std::shared_ptr< Euclid::ThreadPool > & getThreadPool() const
Observer interface to be used with Observable to implement the Observer pattern.
Definition: Observable.h:38
const std::vector< std::string > getOutputProperties()
std::set< std::string > getOutputPropertyNames()
void printPropertyColumnMap(const std::vector< std::string > &properties={})
PluginManager handles the loading of plugins and calls their registration function,...
Definition: PluginManager.h:53
void loadPlugins()
loads all the available plugins. Both those linked at compile-time and those loaded at run-time
static std::shared_ptr< ProcessedImage< T, P > > create(std::shared_ptr< const Image< T >> image_a, std::shared_ptr< const Image< T >> image_b)
The SegmentationFactory will provide a Segmentation implementation based on the current configuration...
virtual void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
void registerPropertyInstances(OutputRegistry &output_registry)
virtual void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
static std::shared_ptr< TileManager > getInstance()
T data(T... args)
T emplace_back(T... args)
T end(T... args)
T endl(T... args)
T find(T... args)
T getenv(T... args)
#define ELEMENTS_API
#define CREATE_MANAGER_WITH_ARGS(MANAGER, ELEMENTS_PROGRAM,...)
constexpr double e
std::underlying_type< ExitCode >::type ExitCodeType
long getUniqueManagerId() noexcept
static auto logger
Definition: WCS.cpp:44
Definition: conf.py:1
T partition(T... args)
T set_terminate(T... args)