SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
44namespace SourceXtractor {
45
46class CheckImages : public Configurable {
47
48public:
49
50 virtual ~CheckImages() = default;
51
52 void saveImages();
53
55 if (index < m_segmentation_images.size()) {
56 auto segmentation_image = m_segmentation_images.at(index);
57 if (segmentation_image != nullptr) {
58 return LockedWriteableImage<int>::create(segmentation_image);
59 }
60 }
61 return nullptr;
62 }
63
65 if (index < m_partition_images.size()) {
66 auto partition_image = m_partition_images.at(index);
67 if (partition_image != nullptr) {
68 return LockedWriteableImage<int>::create(partition_image);
69 }
70 }
71 return nullptr;
72 }
73
75 if (index < m_group_images.size()) {
76 auto group_image = m_group_images.at(index);
77 if (group_image != nullptr) {
78 return LockedWriteableImage<int>::create(group_image);
79 }
80 }
81 return nullptr;
82 }
83
85 if (index < m_auto_aperture_images.size()) {
86 auto auto_aperture_image = m_auto_aperture_images.at(index);
87 if (auto_aperture_image != nullptr) {
88 return LockedWriteableImage<int>::create(auto_aperture_image);
89 }
90 }
91 return nullptr;
92 }
93
95 if (index < m_aperture_images.size()) {
96 auto aperture_image = m_aperture_images.at(index);
97 if (aperture_image != nullptr) {
98 return LockedWriteableImage<int>::create(aperture_image);
99 }
100 }
101 return nullptr;
102 }
103
105 if (index < m_moffat_images.size()) {
106 auto moffat_image = m_moffat_images.at(index);
107 if (moffat_image != nullptr) {
108 return LockedWriteableImage<SeFloat>::create(moffat_image);
109 }
110 }
111 return nullptr;
112 }
113
115
117
119
121
123
124 std::shared_ptr<WriteableImage<float>> getMLDetectionImage(unsigned int plane_number, size_t index);
125
127 m_background_images.emplace_back(background_image);
128 }
129
131 m_measurement_background_images[index] = background_image;
132 }
133
135 m_variance_images.emplace_back(variance_image);
136 }
137
139 m_measurement_variance_images[index] = variance_image;
140 }
141
143 m_filtered_images.emplace_back(filtered_image);
144 }
145
147 m_thresholded_images.emplace_back(thresholded_image);
148 }
149
151 m_snr_images.emplace_back(snr_image);
152 }
153
156
158 void configure(Euclid::Configuration::ConfigManager& manager) override;
159
161 if (m_instance == nullptr) {
162 m_instance.reset(new CheckImages);
163 }
164
165 return *m_instance;
166 }
167
168private:
169 CheckImages();
170
172
179
180 // check image
187
193
200
203
204
206
207 boost::filesystem::path m_model_fitting_image_filename;
208 boost::filesystem::path m_fitting_window_image_filename;
209 boost::filesystem::path m_residual_filename;
210 boost::filesystem::path m_background_filename;
211 boost::filesystem::path m_variance_filename;
212 boost::filesystem::path m_segmentation_filename;
213 boost::filesystem::path m_partition_filename;
214 boost::filesystem::path m_group_filename;
215 boost::filesystem::path m_filtered_filename;
216 boost::filesystem::path m_thresholded_filename;
217 boost::filesystem::path m_snr_filename;
218 boost::filesystem::path m_auto_aperture_filename;
219 boost::filesystem::path m_aperture_filename;
220 boost::filesystem::path m_moffat_filename;
221 boost::filesystem::path m_psf_filename;
222 boost::filesystem::path m_ml_detection_filename;
223
224 boost::filesystem::path m_measurement_background_filename;
225 boost::filesystem::path m_measurement_variance_filename;
226
228
230
232};
233
234}
235
236
237
238#endif /* _SEIMPLEMENTATION_CHECKIMAGES_CHECKIMAGES_H_ */
boost::filesystem::path m_partition_filename
std::shared_ptr< WriteableImage< int > > getGroupImage(size_t index) const
Definition CheckImages.h:74
std::vector< std::shared_ptr< WeightImage > > m_variance_images
std::vector< std::shared_ptr< DetectionImage > > m_detection_images
std::map< unsigned int, std::shared_ptr< WriteableImage< int > > > m_measurement_aperture_images
void addMeasurementBackgroundCheckImage(size_t index, std::shared_ptr< Image< SeFloat > > background_image)
std::shared_ptr< WriteableImage< int > > getMeasurementAutoApertureImage(unsigned int frame_number)
void addVarianceCheckImage(std::shared_ptr< Image< SeFloat > > variance_image)
boost::filesystem::path m_group_filename
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_psf
boost::filesystem::path m_ml_detection_filename
void setCustomCheckImage(std::string id, std::shared_ptr< Image< SeFloat > > image)
boost::filesystem::path m_variance_filename
boost::filesystem::path m_residual_filename
std::map< unsigned int, std::shared_ptr< WriteableImage< int > > > m_measurement_auto_aperture_images
boost::filesystem::path m_filtered_filename
boost::filesystem::path m_fitting_window_image_filename
void addFilteredCheckImage(std::shared_ptr< Image< SeFloat > > filtered_image)
std::shared_ptr< WriteableImage< int > > getMeasurementApertureImage(unsigned int frame_number)
std::map< unsigned int, std::shared_ptr< Image< SeFloat > > > m_measurement_background_images
std::vector< std::shared_ptr< WriteableImage< int > > > m_group_images
std::shared_ptr< WriteableImage< float > > getMLDetectionImage(unsigned int plane_number, size_t index)
static std::unique_ptr< CheckImages > m_instance
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
std::shared_ptr< WriteableImage< SeFloat > > getWriteableCheckImage(std::string id, int width, int height)
std::shared_ptr< WriteableImage< int > > getFittingWindowImage(unsigned int frame_number)
virtual ~CheckImages()=default
boost::filesystem::path m_auto_aperture_filename
void addSnrCheckImage(std::shared_ptr< Image< SeFloat > > snr_image)
static CheckImages & getInstance()
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_model_fitting
boost::filesystem::path m_moffat_filename
void addBackgroundCheckImage(std::shared_ptr< Image< SeFloat > > background_image)
std::shared_ptr< WriteableImage< SeFloat > > getMoffatImage(size_t index) const
void addMeasurementVarianceCheckImage(size_t index, std::shared_ptr< Image< SeFloat > > variance_image)
std::vector< std::shared_ptr< Image< SeFloat > > > m_filtered_images
std::shared_ptr< WriteableImage< int > > getSegmentationImage(size_t index) const
Definition CheckImages.h:54
boost::filesystem::path m_snr_filename
std::vector< std::shared_ptr< Image< SeFloat > > > m_thresholded_images
boost::filesystem::path m_measurement_variance_filename
boost::filesystem::path m_psf_filename
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getPsfImage(unsigned int frame_number)
std::vector< std::shared_ptr< CoordinateSystem > > m_coordinate_systems
std::vector< std::shared_ptr< WriteableImage< int > > > m_partition_images
std::vector< std::shared_ptr< WriteableImage< int > > > m_aperture_images
boost::filesystem::path m_measurement_background_filename
boost::filesystem::path m_segmentation_filename
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
std::vector< std::shared_ptr< WriteableImage< int > > > m_segmentation_images
void addThresholdedCheckImage(std::shared_ptr< Image< SeFloat > > thresholded_image)
std::vector< std::map< unsigned int, std::shared_ptr< WriteableImage< float > > > > m_check_image_ml_detection
std::shared_ptr< WriteableImage< int > > getDetectionApertureImage(size_t index) const
Definition CheckImages.h:94
boost::filesystem::path m_thresholded_filename
boost::filesystem::path m_aperture_filename
std::vector< std::shared_ptr< Image< SeFloat > > > m_snr_images
std::vector< std::shared_ptr< WriteableImage< int > > > m_auto_aperture_images
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getModelFittingImage(unsigned int frame_number)
boost::filesystem::path m_background_filename
std::map< unsigned int, std::shared_ptr< WeightImage > > m_measurement_variance_images
std::vector< std::shared_ptr< WriteableImage< SeFloat > > > m_moffat_images
boost::filesystem::path m_model_fitting_image_filename
std::shared_ptr< WriteableImage< int > > getPartitionImage(size_t index) const
Definition CheckImages.h:64
std::map< int, FrameInfo > m_measurement_frames
std::shared_ptr< WriteableImage< int > > getDetectionAutoApertureImage(size_t index) const
Definition CheckImages.h:84
std::vector< std::shared_ptr< Image< SeFloat > > > m_background_images
std::map< unsigned int, std::shared_ptr< WriteableImage< int > > > m_check_image_fitting_window
std::map< boost::filesystem::path, std::tuple< std::shared_ptr< Image< SeFloat > >, bool > > m_custom_images
Interface of objects which can be configured.
Interface representing an image.
Definition Image.h:44
static std::shared_ptr< LockedWriteableImage< T > > create(Args &&... args)
std::shared_ptr< CoordinateSystem > m_coordinate_system
std::shared_ptr< DetectionImage > m_subtracted_image