SourceXtractorPlusPlus  0.15
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);
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  auto sorter = std::make_shared<Sorter>();
386 
387  // Link together the pipeline's steps
388  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(partition);
389 
390  if (prefetcher) {
391  segmentation->Observable<ProcessSourcesEvent>::addObserver(prefetcher);
392  prefetcher->Observable<ProcessSourcesEvent>::addObserver(source_grouping);
393  partition->addObserver(prefetcher);
394  prefetcher->Observable<std::shared_ptr<SourceInterface>>::addObserver(source_grouping);
395  }
396  else {
397  segmentation->Observable<ProcessSourcesEvent>::addObserver(source_grouping);
398  partition->addObserver(source_grouping);
399  }
400 
401  source_grouping->addObserver(deblending);
402  deblending->addObserver(measurement);
403  measurement->addObserver(sorter);
404  sorter->addObserver(output);
405 
406  segmentation->Observable<SegmentationProgress>::addObserver(progress_mediator->getSegmentationObserver());
407  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(progress_mediator->getDetectionObserver());
408  deblending->addObserver(progress_mediator->getDeblendingObserver());
409  measurement->addObserver(progress_mediator->getMeasurementObserver());
410 
411  // Add observers for CheckImages
412  if (CheckImages::getInstance().getSegmentationImage() != nullptr) {
413  segmentation->Observable<std::shared_ptr<SourceInterface>>::addObserver(
414  std::make_shared<DetectionIdCheckImage>());
415  }
416  if (CheckImages::getInstance().getPartitionImage() != nullptr) {
417  measurement->addObserver(
418  std::make_shared<SourceIdCheckImage>());
419  }
420  if (CheckImages::getInstance().getGroupImage() != nullptr) {
421  measurement->addObserver(
422  std::make_shared<GroupIdCheckImage>());
423  }
424  if (CheckImages::getInstance().getMoffatImage() != nullptr) {
425  measurement->addObserver(
426  std::make_shared<MoffatCheckImage>());
427  }
428 
429  auto interpolation_gap = config_manager.getConfiguration<DetectionImageConfig>().getInterpolationGap();
430  auto detection_frame = std::make_shared<DetectionImageFrame>(detection_image, weight_image,
431  weight_threshold, detection_image_coordinate_system, detection_image_gain,
432  detection_image_saturation, interpolation_gap);
433  detection_frame->setLabel(boost::filesystem::basename(detection_image_path));
434 
435  auto background_analyzer = config_manager.getConfiguration<BackgroundAnalyzerFactory>().createBackgroundAnalyzer();
436  auto background_model = background_analyzer->analyzeBackground(detection_frame->getOriginalImage(), weight_image,
437  ConstantImage<unsigned char>::create(detection_image->getWidth(), detection_image->getHeight(), false), detection_frame->getVarianceThreshold());
438 
439  // initial set of the variance and background check images, might be overwritten below
440  CheckImages::getInstance().setBackgroundCheckImage(background_model.getLevelMap());
441  CheckImages::getInstance().setVarianceCheckImage(background_model.getVarianceMap());
442 
443  detection_frame->setBackgroundLevel(background_model.getLevelMap(), background_model.getMedianRms());
444 
445  if (weight_image != nullptr) {
446  if (is_weight_absolute) {
447  detection_frame->setVarianceMap(weight_image);
448  } else {
449  auto scaled_image = MultiplyImage<SeFloat>::create(weight_image, background_model.getScalingFactor());
450  detection_frame->setVarianceMap(scaled_image);
451  }
452  } else {
453  detection_frame->setVarianceMap(background_model.getVarianceMap());
454  }
455  // re-set the variance check image to what's in the detection_frame()
456  CheckImages::getInstance().setVarianceCheckImage(detection_frame->getVarianceMap());
457 
458  const auto& background_config = config_manager.getConfiguration<BackgroundConfig>();
459 
460  // Override background level and threshold if requested by the user
461  if (background_config.isBackgroundLevelAbsolute()) {
463  detection_image->getWidth(), detection_image->getHeight(), background_config.getBackgroundLevel());
464 
465  detection_frame->setBackgroundLevel(background, 0.);
467  }
468 
469  if (background_config.isDetectionThresholdAbsolute()) {
470  detection_frame->setDetectionThreshold(background_config.getDetectionThreshold());
471  }
472  CheckImages::getInstance().setVarianceCheckImage(detection_frame->getVarianceMap());
473 
474  //CheckImages::getInstance().setFilteredCheckImage(detection_frame->getFilteredImage());
475 
476  // Perform measurements (multi-threaded part)
477  measurement->startThreads();
478 
479  try {
480  // Process the image
481  segmentation->processFrame(detection_frame);
482  }
483  catch (const std::exception &e) {
484  logger.error() << "Failed to process the frame! " << e.what();
485  measurement->waitForThreads();
487  }
488 
489  if (prefetcher) {
490  prefetcher->wait();
491  }
492  measurement->waitForThreads();
493 
494  CheckImages::getInstance().setFilteredCheckImage(detection_frame->getFilteredImage());
495  CheckImages::getInstance().setThresholdedCheckImage(detection_frame->getThresholdedImage());
496  CheckImages::getInstance().setSnrCheckImage(detection_frame->getSnrImage());
498  TileManager::getInstance()->flush();
499 
500  size_t n_writen_rows = output->flush();
501 
502  progress_mediator->done();
503 
504  if (n_writen_rows > 0) {
505  logger.info() << n_writen_rows << " sources detected";
506  } else {
507  logger.info() << "NO SOURCES DETECTED";
508  }
509 
510  return Elements::ExitCode::OK;
511  }
512 };
513 
514 
516 
517 public:
519  m_plugin_path(plugin_path), m_plugin_list(plugin_list) {
520  }
521 
522  virtual ~PluginOptionsMain() = default;
523 
524  boost::program_options::options_description defineSpecificProgramOptions() override {
525  auto& config_manager = ConfigManager::getInstance(conf_man_id);
526  config_manager.registerConfiguration<PluginConfig>();
527  auto options = config_manager.closeRegistration();
528  // The following will consume any extra options in the configuration file
529  options.add_options()("*", po::value<std::vector<std::string>>());
530  return options;
531  }
532 
534  auto& config_manager = ConfigManager::getInstance(conf_man_id);
535  config_manager.initialize(args);
536  auto& conf = config_manager.getConfiguration<PluginConfig>();
537  m_plugin_path = conf.getPluginPath();
538  m_plugin_list = conf.getPluginList();
539  return Elements::ExitCode::OK;
540  }
541 
542 private:
543 
544  long conf_man_id = getUniqueManagerId();
547 
548 };
549 
550 
551 static void forwardOptions(int argc, char *const *argv, std::vector<std::string>& plugin_options_input) {
552  for (int i = 0; i < argc; ++i) {
553  std::string option{argv[i]};
554  if (option == "--config-file") {
555  plugin_options_input.emplace_back("--config-file");
556  plugin_options_input.emplace_back(std::string{argv[i + 1]});
557  }
558  if (boost::starts_with(option, "--config-file=")) {
559  plugin_options_input.emplace_back(option);
560  }
561  if (option == "--plugin-directory") {
562  plugin_options_input.emplace_back("--plugin-directory");
563  plugin_options_input.emplace_back(std::string{argv[i + 1]});
564  }
565  if (boost::starts_with(option, "--plugin-directory=")) {
566  plugin_options_input.emplace_back(option);
567  }
568  if (option == "--plugin") {
569  plugin_options_input.emplace_back("--plugin");
570  plugin_options_input.emplace_back(std::string{argv[i + 1]});
571  }
572  if (boost::starts_with(option, "--plugin=")) {
573  plugin_options_input.emplace_back(option);
574  }
575  }
576 }
577 
578 
579 ELEMENTS_API int main(int argc, char* argv[]) {
580  std::string plugin_path {};
581  std::vector<std::string> plugin_list {};
582 
583  // This adds the current directory as a valid location for the default "sourcextractor++.conf" configuration
584  Elements::TempEnv local_env;
585  if (local_env["ELEMENTS_CONF_PATH"].empty()) {
586  local_env["ELEMENTS_CONF_PATH"] = ".:/etc";
587  } else {
588  local_env["ELEMENTS_CONF_PATH"] = ".:" + local_env["ELEMENTS_CONF_PATH"] + ":/etc";
589  }
590 
592 
593  // Try to be reasonably graceful with unhandled exceptions
595 
596  try {
597  // First we create a program which has a sole purpose to get the options for
598  // the plugin paths. Note that we do not want to have this helper program
599  // to handle any other options except of the plugin-directory and plugin, so
600  // we create a subset of the given options with only the necessary ones. We
601  // also turn off the the logging.
602  std::vector<int> masked_indices{};
603  std::vector<std::string> plugin_options_input{};
604  plugin_options_input.emplace_back("DummyProgram");
605  plugin_options_input.emplace_back("--log-level");
606  plugin_options_input.emplace_back("ERROR");
607  forwardOptions(argc, argv, plugin_options_input);
608 
609  int argc_tmp = plugin_options_input.size();
610  std::vector<const char *> argv_tmp(argc_tmp);
611  for (unsigned int i = 0; i < plugin_options_input.size(); ++i) {
612  auto& option_str = plugin_options_input[i];
613  argv_tmp[i] = option_str.data();
614  }
615 
616  CREATE_MANAGER_WITH_ARGS(plugin_options_program, PluginOptionsMain, plugin_path, plugin_list);
617  plugin_options_program.run(argc_tmp, const_cast<char **>(argv_tmp.data()));
618 
619  CREATE_MANAGER_WITH_ARGS(main, SEMain, plugin_path, plugin_list);
620  Elements::ExitCode exit_code = main.run(argc, argv);
621  return static_cast<Elements::ExitCodeType>(exit_code);
622  }
623  catch (const std::exception &e) {
624  logger.fatal() << e.what();
626  }
627  catch (...) {
628  logger.fatal() << "Unknown exception type!";
629  logger.fatal() << "Please, report this as a bug";
631  }
632 }
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:114
void setBackgroundCheckImage(std::shared_ptr< Image< SeFloat >> background_image)
Definition: CheckImages.h:110
void setSnrCheckImage(std::shared_ptr< Image< SeFloat >> snr_image)
Definition: CheckImages.h:126
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:122
static CheckImages & getInstance()
Definition: CheckImages.h:136
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:118
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()
static auto logger
Definition: WCS.cpp:44
Definition: conf.py:1
T partition(T... args)
T set_terminate(T... args)