SourceXtractorPlusPlus  0.16
Please provide a description of the project.
CheckImages.h
Go to the documentation of this file.
1 
17 /*
18  * CheckImages.h
19  *
20  * Created on: May 30, 2017
21  * Author: mschefer
22  */
23 
24 #ifndef _SEIMPLEMENTATION_CHECKIMAGES_CHECKIMAGES_H_
25 #define _SEIMPLEMENTATION_CHECKIMAGES_CHECKIMAGES_H_
26 
27 #include <mutex>
28 #include <map>
29 #include <iostream>
30 
31 #include <boost/filesystem/path.hpp>
32 
40 
42 
43 
44 namespace SourceXtractor {
45 
46 class CheckImages : public Configurable {
47 
48 public:
49 
50  virtual ~CheckImages() = default;
51 
52  void saveImages();
53 
55  if (m_segmentation_image != nullptr) {
57  } else {
58  return nullptr;
59  }
60  }
61 
63  if (m_partition_image != nullptr) {
65  } else {
66  return nullptr;
67  }
68  }
69 
71  if (m_group_image != nullptr) {
73  } else {
74  return nullptr;
75  }
76  }
77 
79  if (m_auto_aperture_image != nullptr) {
81  } else {
82  return nullptr;
83  }
84  }
85 
87  if (m_aperture_image != nullptr) {
89  } else {
90  return nullptr;
91  }
92  }
93 
95  if (m_moffat_image != nullptr) {
97  } else {
98  return nullptr;
99  }
100  }
101 
102  std::shared_ptr<WriteableImage<int>> getAutoApertureImage(unsigned int frame_number);
103 
104  std::shared_ptr<WriteableImage<int>> getApertureImage(unsigned int frame_number);
105 
107 
109 
111 
113  m_background_image = background_image;
114  }
115 
117  m_variance_image = variance_image;
118  }
119 
121  m_filtered_image = filtered_image;
122  }
123 
125  m_thresholded_image = thresholded_image;
126  }
127 
129  m_snr_image = snr_image;
130  }
131 
134 
135  virtual void reportConfigDependencies(Euclid::Configuration::ConfigManager& manager) const override;
136  virtual void configure(Euclid::Configuration::ConfigManager& manager) override;
137 
139  if (m_instance == nullptr) {
140  m_instance.reset(new CheckImages);
141  }
142 
143  return *m_instance;
144  }
145 
146 private:
147  CheckImages();
148 
150 
151  struct FrameInfo {
156  };
157 
158  // check image
169 
177 
178  boost::filesystem::path m_model_fitting_image_filename;
179  boost::filesystem::path m_residual_filename;
180  boost::filesystem::path m_model_background_filename;
181  boost::filesystem::path m_model_variance_filename;
182  boost::filesystem::path m_segmentation_filename;
183  boost::filesystem::path m_partition_filename;
184  boost::filesystem::path m_group_filename;
185  boost::filesystem::path m_filtered_filename;
186  boost::filesystem::path m_thresholded_filename;
187  boost::filesystem::path m_snr_filename;
188  boost::filesystem::path m_auto_aperture_filename;
189  boost::filesystem::path m_aperture_filename;
190  boost::filesystem::path m_moffat_filename;
191  boost::filesystem::path m_psf_filename;
192  boost::filesystem::path m_ml_detection_filename;
193 
195 
197 
199 };
200 
201 }
202 
203 
204 
205 #endif /* _SEIMPLEMENTATION_CHECKIMAGES_CHECKIMAGES_H_ */
void setVarianceCheckImage(std::shared_ptr< Image< SeFloat >> variance_image)
Definition: CheckImages.h:116
boost::filesystem::path m_partition_filename
Definition: CheckImages.h:183
std::shared_ptr< WriteableImage< float > > getMLDetectionImage(unsigned int plane_number)
boost::filesystem::path m_group_filename
Definition: CheckImages.h:184
std::shared_ptr< WriteableImage< int > > getApertureImage() const
Definition: CheckImages.h:86
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_psf
Definition: CheckImages.h:167
std::shared_ptr< WriteableImage< int > > m_segmentation_image
Definition: CheckImages.h:159
std::shared_ptr< WriteableImage< SeFloat > > m_moffat_image
Definition: CheckImages.h:164
std::map< unsigned int, decltype(m_auto_aperture_image)> m_measurement_auto_aperture_images
Definition: CheckImages.h:166
boost::filesystem::path m_ml_detection_filename
Definition: CheckImages.h:192
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
boost::filesystem::path m_residual_filename
Definition: CheckImages.h:179
std::shared_ptr< WriteableImage< int > > getSegmentationImage() const
Definition: CheckImages.h:54
boost::filesystem::path m_filtered_filename
Definition: CheckImages.h:185
std::shared_ptr< WriteableImage< int > > m_partition_image
Definition: CheckImages.h:160
std::shared_ptr< Image< SeFloat > > m_filtered_image
Definition: CheckImages.h:172
boost::filesystem::path m_model_background_filename
Definition: CheckImages.h:180
std::shared_ptr< WeightImage > m_variance_image
Definition: CheckImages.h:175
static std::unique_ptr< CheckImages > m_instance
Definition: CheckImages.h:149
boost::filesystem::path m_model_variance_filename
Definition: CheckImages.h:181
virtual void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition: CheckImages.cpp:67
std::shared_ptr< WriteableImage< SeFloat > > getWriteableCheckImage(std::string id, int width, int height)
Definition: CheckImages.cpp:47
virtual ~CheckImages()=default
boost::filesystem::path m_auto_aperture_filename
Definition: CheckImages.h:188
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_model_fitting
Definition: CheckImages.h:167
boost::filesystem::path m_moffat_filename
Definition: CheckImages.h:190
std::shared_ptr< WriteableImage< int > > getPartitionImage() const
Definition: CheckImages.h:62
std::shared_ptr< Image< SeFloat > > m_snr_image
Definition: CheckImages.h:174
boost::filesystem::path m_snr_filename
Definition: CheckImages.h:187
std::shared_ptr< WriteableImage< int > > m_auto_aperture_image
Definition: CheckImages.h:162
void setThresholdedCheckImage(std::shared_ptr< Image< SeFloat >> thresholded_image)
Definition: CheckImages.h:124
boost::filesystem::path m_psf_filename
Definition: CheckImages.h:191
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getPsfImage(unsigned int frame_number)
static CheckImages & getInstance()
Definition: CheckImages.h:138
boost::filesystem::path m_segmentation_filename
Definition: CheckImages.h:182
virtual void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition: CheckImages.cpp:40
std::shared_ptr< WriteableImage< int > > getAutoApertureImage() const
Definition: CheckImages.h:78
std::shared_ptr< WriteableImage< int > > m_aperture_image
Definition: CheckImages.h:163
std::map< unsigned int, decltype(m_aperture_image)> m_measurement_aperture_images
Definition: CheckImages.h:165
std::shared_ptr< CoordinateSystem > m_coordinate_system
Definition: CheckImages.h:176
std::shared_ptr< WriteableImage< int > > m_group_image
Definition: CheckImages.h:161
boost::filesystem::path m_thresholded_filename
Definition: CheckImages.h:186
void setFilteredCheckImage(std::shared_ptr< Image< SeFloat >> filtered_image)
Definition: CheckImages.h:120
boost::filesystem::path m_aperture_filename
Definition: CheckImages.h:189
std::shared_ptr< WriteableImage< SeFloat > > getMoffatImage() const
Definition: CheckImages.h:94
std::shared_ptr< Image< SeFloat > > m_background_image
Definition: CheckImages.h:171
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getModelFittingImage(unsigned int frame_number)
boost::filesystem::path m_model_fitting_image_filename
Definition: CheckImages.h:178
void setCustomCheckImage(std::string id, std::shared_ptr< Image< SeFloat >> image)
Definition: CheckImages.cpp:63
std::shared_ptr< DetectionImage > m_detection_image
Definition: CheckImages.h:170
std::map< unsigned int, std::shared_ptr< WriteableImage< float > > > m_check_image_ml_detection
Definition: CheckImages.h:168
std::map< int, FrameInfo > m_measurement_frames
Definition: CheckImages.h:196
std::shared_ptr< WriteableImage< int > > getGroupImage() const
Definition: CheckImages.h:70
std::shared_ptr< Image< SeFloat > > m_thresholded_image
Definition: CheckImages.h:173
std::map< boost::filesystem::path, std::tuple< std::shared_ptr< Image< SeFloat > >, bool > > m_custom_images
Definition: CheckImages.h:194
Interface of objects which can be configured.
Definition: Configurable.h:37
Interface representing an image.
Definition: Image.h:43
static std::shared_ptr< LockedWriteableImage< T > > create(Args &&... args)
std::shared_ptr< CoordinateSystem > m_coordinate_system
Definition: CheckImages.h:154
std::shared_ptr< DetectionImage > m_subtracted_image
Definition: CheckImages.h:155