SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEImplementation
SEImplementation
CheckImages
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
33
#include "
SEFramework/Configuration/Configurable.h
"
34
#include "
SEFramework/CoordinateSystem/CoordinateSystem.h
"
35
#include "
SEFramework/Image/Image.h
"
36
#include "
SEFramework/Image/VectorImage.h
"
37
#include "
SEFramework/Image/ProcessedImage.h
"
38
#include "
SEFramework/Image/WriteableImage.h
"
39
#include "
SEFramework/Frame/Frame.h
"
40
41
#include "
SEImplementation/Image/LockedWriteableImage.h
"
42
43
44
namespace
SourceXtractor
{
45
46
class
CheckImages
:
public
Configurable
{
47
48
public
:
49
50
virtual
~CheckImages
() =
default
;
51
52
void
saveImages
();
53
54
std::shared_ptr<WriteableImage<int>
>
getSegmentationImage
()
const
{
55
if
(
m_segmentation_image
!=
nullptr
) {
56
return
LockedWriteableImage<int>::create
(
m_segmentation_image
);
57
}
else
{
58
return
nullptr
;
59
}
60
}
61
62
std::shared_ptr<WriteableImage<int>
>
getPartitionImage
()
const
{
63
if
(
m_partition_image
!=
nullptr
) {
64
return
LockedWriteableImage<int>::create
(
m_partition_image
);
65
}
else
{
66
return
nullptr
;
67
}
68
}
69
70
std::shared_ptr<WriteableImage<int>
>
getGroupImage
()
const
{
71
if
(
m_group_image
!=
nullptr
) {
72
return
LockedWriteableImage<int>::create
(
m_group_image
);
73
}
else
{
74
return
nullptr
;
75
}
76
}
77
78
std::shared_ptr<WriteableImage<int>
>
getAutoApertureImage
()
const
{
79
if
(
m_auto_aperture_image
!=
nullptr
) {
80
return
LockedWriteableImage<int>::create
(
m_auto_aperture_image
);
81
}
else
{
82
return
nullptr
;
83
}
84
}
85
86
std::shared_ptr<WriteableImage<int>
>
getApertureImage
()
const
{
87
if
(
m_aperture_image
!=
nullptr
) {
88
return
LockedWriteableImage<int>::create
(
m_aperture_image
);
89
}
else
{
90
return
nullptr
;
91
}
92
}
93
94
std::shared_ptr<WriteableImage<SeFloat>
>
getMoffatImage
()
const
{
95
if
(
m_moffat_image
!=
nullptr
) {
96
return
LockedWriteableImage<SeFloat>::create
(
m_moffat_image
);
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
106
std::shared_ptr<WriteableImage<MeasurementImage::PixelType>
>
getModelFittingImage
(
unsigned
int
frame_number);
107
108
std::shared_ptr<WriteableImage<MeasurementImage::PixelType>
>
getPsfImage
(
unsigned
int
frame_number);
109
110
void
setBackgroundCheckImage
(
std::shared_ptr
<
Image<SeFloat>
> background_image) {
111
m_background_image
= background_image;
112
}
113
114
void
setVarianceCheckImage
(
std::shared_ptr
<
Image<SeFloat>
> variance_image) {
115
m_variance_image
= variance_image;
116
}
117
118
void
setFilteredCheckImage
(
std::shared_ptr
<
Image<SeFloat>
> filtered_image) {
119
m_filtered_image
= filtered_image;
120
}
121
122
void
setThresholdedCheckImage
(
std::shared_ptr
<
Image<SeFloat>
> thresholded_image) {
123
m_thresholded_image
= thresholded_image;
124
}
125
126
void
setSnrCheckImage
(
std::shared_ptr
<
Image<SeFloat>
> snr_image) {
127
m_snr_image
= snr_image;
128
}
129
130
std::shared_ptr<WriteableImage<SeFloat>
>
getWriteableCheckImage
(
std::string
id
,
int
width,
int
height);
131
void
setCustomCheckImage
(
std::string
id
,
std::shared_ptr
<
Image<SeFloat>
> image);
132
133
virtual
void
reportConfigDependencies
(
Euclid::Configuration::ConfigManager
& manager)
const override
;
134
virtual
void
configure
(
Euclid::Configuration::ConfigManager
& manager)
override
;
135
136
static
CheckImages
&
getInstance
() {
137
if
(
m_instance
==
nullptr
) {
138
m_instance
.reset(
new
CheckImages
);
139
}
140
141
return
*
m_instance
;
142
}
143
144
private
:
145
CheckImages
();
146
147
static
std::unique_ptr<CheckImages>
m_instance
;
148
149
struct
FrameInfo
{
150
std::string
m_label
;
151
int
m_width
,
m_height
;
152
std::shared_ptr<CoordinateSystem>
m_coordinate_system
;
153
std::shared_ptr<DetectionImage>
m_subtracted_image
;
154
};
155
156
// check image
157
std::shared_ptr<WriteableImage<int>
>
m_segmentation_image
;
158
std::shared_ptr<WriteableImage<int>
>
m_partition_image
;
159
std::shared_ptr<WriteableImage<int>
>
m_group_image
;
160
std::shared_ptr<WriteableImage<int>
>
m_auto_aperture_image
;
161
std::shared_ptr<WriteableImage<int>
>
m_aperture_image
;
162
std::shared_ptr<WriteableImage<SeFloat>
>
m_moffat_image
;
163
std::map
<
unsigned
int, decltype(
m_aperture_image
)>
m_measurement_aperture_images
;
164
std::map
<
unsigned
int, decltype(
m_auto_aperture_image
)>
m_measurement_auto_aperture_images
;
165
std::map<unsigned int, std::shared_ptr<WriteableImage<MeasurementImage::PixelType>
>>
m_check_image_model_fitting
,
m_check_image_psf
;
166
167
std::shared_ptr<DetectionImage>
m_detection_image
;
168
std::shared_ptr<Image<SeFloat>
>
m_background_image
;
169
std::shared_ptr<Image<SeFloat>
>
m_filtered_image
;
170
std::shared_ptr<Image<SeFloat>
>
m_thresholded_image
;
171
std::shared_ptr<Image<SeFloat>
>
m_snr_image
;
172
std::shared_ptr<WeightImage>
m_variance_image
;
173
std::shared_ptr<CoordinateSystem>
m_coordinate_system
;
174
175
boost::filesystem::path
m_model_fitting_image_filename
;
176
boost::filesystem::path
m_residual_filename
;
177
boost::filesystem::path
m_model_background_filename
;
178
boost::filesystem::path
m_model_variance_filename
;
179
boost::filesystem::path
m_segmentation_filename
;
180
boost::filesystem::path
m_partition_filename
;
181
boost::filesystem::path
m_group_filename
;
182
boost::filesystem::path
m_filtered_filename
;
183
boost::filesystem::path
m_thresholded_filename
;
184
boost::filesystem::path
m_snr_filename
;
185
boost::filesystem::path
m_auto_aperture_filename
;
186
boost::filesystem::path
m_aperture_filename
;
187
boost::filesystem::path
m_moffat_filename
;
188
boost::filesystem::path
m_psf_filename
;
189
190
std::map<boost::filesystem::path, std::tuple<std::shared_ptr<Image<SeFloat>
>,
bool
>>
m_custom_images
;
191
192
std::map<int, FrameInfo>
m_measurement_frames
;
193
194
std::mutex
m_access_mutex
;
195
};
196
197
}
198
199
200
201
#endif
/* _SEIMPLEMENTATION_CHECKIMAGES_CHECKIMAGES_H_ */
Configurable.h
CoordinateSystem.h
Frame.h
Image.h
LockedWriteableImage.h
ProcessedImage.h
VectorImage.h
WriteableImage.h
std::string
Euclid::Configuration::ConfigManager
SourceXtractor::CheckImages
Definition:
CheckImages.h:46
SourceXtractor::CheckImages::setVarianceCheckImage
void setVarianceCheckImage(std::shared_ptr< Image< SeFloat >> variance_image)
Definition:
CheckImages.h:114
SourceXtractor::CheckImages::m_partition_filename
boost::filesystem::path m_partition_filename
Definition:
CheckImages.h:180
SourceXtractor::CheckImages::m_group_filename
boost::filesystem::path m_group_filename
Definition:
CheckImages.h:181
SourceXtractor::CheckImages::getApertureImage
std::shared_ptr< WriteableImage< int > > getApertureImage() const
Definition:
CheckImages.h:86
SourceXtractor::CheckImages::m_check_image_psf
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_psf
Definition:
CheckImages.h:165
SourceXtractor::CheckImages::m_segmentation_image
std::shared_ptr< WriteableImage< int > > m_segmentation_image
Definition:
CheckImages.h:157
SourceXtractor::CheckImages::m_moffat_image
std::shared_ptr< WriteableImage< SeFloat > > m_moffat_image
Definition:
CheckImages.h:162
SourceXtractor::CheckImages::m_measurement_auto_aperture_images
std::map< unsigned int, decltype(m_auto_aperture_image)> m_measurement_auto_aperture_images
Definition:
CheckImages.h:164
SourceXtractor::CheckImages::setBackgroundCheckImage
void setBackgroundCheckImage(std::shared_ptr< Image< SeFloat >> background_image)
Definition:
CheckImages.h:110
SourceXtractor::CheckImages::setSnrCheckImage
void setSnrCheckImage(std::shared_ptr< Image< SeFloat >> snr_image)
Definition:
CheckImages.h:126
SourceXtractor::CheckImages::m_residual_filename
boost::filesystem::path m_residual_filename
Definition:
CheckImages.h:176
SourceXtractor::CheckImages::getSegmentationImage
std::shared_ptr< WriteableImage< int > > getSegmentationImage() const
Definition:
CheckImages.h:54
SourceXtractor::CheckImages::m_filtered_filename
boost::filesystem::path m_filtered_filename
Definition:
CheckImages.h:182
SourceXtractor::CheckImages::m_partition_image
std::shared_ptr< WriteableImage< int > > m_partition_image
Definition:
CheckImages.h:158
SourceXtractor::CheckImages::m_filtered_image
std::shared_ptr< Image< SeFloat > > m_filtered_image
Definition:
CheckImages.h:169
SourceXtractor::CheckImages::m_model_background_filename
boost::filesystem::path m_model_background_filename
Definition:
CheckImages.h:177
SourceXtractor::CheckImages::m_variance_image
std::shared_ptr< WeightImage > m_variance_image
Definition:
CheckImages.h:172
SourceXtractor::CheckImages::m_instance
static std::unique_ptr< CheckImages > m_instance
Definition:
CheckImages.h:147
SourceXtractor::CheckImages::m_model_variance_filename
boost::filesystem::path m_model_variance_filename
Definition:
CheckImages.h:178
SourceXtractor::CheckImages::configure
virtual void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition:
CheckImages.cpp:67
SourceXtractor::CheckImages::getWriteableCheckImage
std::shared_ptr< WriteableImage< SeFloat > > getWriteableCheckImage(std::string id, int width, int height)
Definition:
CheckImages.cpp:47
SourceXtractor::CheckImages::~CheckImages
virtual ~CheckImages()=default
SourceXtractor::CheckImages::m_auto_aperture_filename
boost::filesystem::path m_auto_aperture_filename
Definition:
CheckImages.h:185
SourceXtractor::CheckImages::m_check_image_model_fitting
std::map< unsigned int, std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > > m_check_image_model_fitting
Definition:
CheckImages.h:165
SourceXtractor::CheckImages::m_moffat_filename
boost::filesystem::path m_moffat_filename
Definition:
CheckImages.h:187
SourceXtractor::CheckImages::getPartitionImage
std::shared_ptr< WriteableImage< int > > getPartitionImage() const
Definition:
CheckImages.h:62
SourceXtractor::CheckImages::m_snr_image
std::shared_ptr< Image< SeFloat > > m_snr_image
Definition:
CheckImages.h:171
SourceXtractor::CheckImages::m_snr_filename
boost::filesystem::path m_snr_filename
Definition:
CheckImages.h:184
SourceXtractor::CheckImages::m_auto_aperture_image
std::shared_ptr< WriteableImage< int > > m_auto_aperture_image
Definition:
CheckImages.h:160
SourceXtractor::CheckImages::setThresholdedCheckImage
void setThresholdedCheckImage(std::shared_ptr< Image< SeFloat >> thresholded_image)
Definition:
CheckImages.h:122
SourceXtractor::CheckImages::m_psf_filename
boost::filesystem::path m_psf_filename
Definition:
CheckImages.h:188
SourceXtractor::CheckImages::getPsfImage
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getPsfImage(unsigned int frame_number)
Definition:
CheckImages.cpp:226
SourceXtractor::CheckImages::getInstance
static CheckImages & getInstance()
Definition:
CheckImages.h:136
SourceXtractor::CheckImages::m_segmentation_filename
boost::filesystem::path m_segmentation_filename
Definition:
CheckImages.h:179
SourceXtractor::CheckImages::reportConfigDependencies
virtual void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition:
CheckImages.cpp:40
SourceXtractor::CheckImages::getAutoApertureImage
std::shared_ptr< WriteableImage< int > > getAutoApertureImage() const
Definition:
CheckImages.h:78
SourceXtractor::CheckImages::m_aperture_image
std::shared_ptr< WriteableImage< int > > m_aperture_image
Definition:
CheckImages.h:161
SourceXtractor::CheckImages::CheckImages
CheckImages()
Definition:
CheckImages.cpp:37
SourceXtractor::CheckImages::m_measurement_aperture_images
std::map< unsigned int, decltype(m_aperture_image)> m_measurement_aperture_images
Definition:
CheckImages.h:163
SourceXtractor::CheckImages::m_coordinate_system
std::shared_ptr< CoordinateSystem > m_coordinate_system
Definition:
CheckImages.h:173
SourceXtractor::CheckImages::m_group_image
std::shared_ptr< WriteableImage< int > > m_group_image
Definition:
CheckImages.h:159
SourceXtractor::CheckImages::m_thresholded_filename
boost::filesystem::path m_thresholded_filename
Definition:
CheckImages.h:183
SourceXtractor::CheckImages::setFilteredCheckImage
void setFilteredCheckImage(std::shared_ptr< Image< SeFloat >> filtered_image)
Definition:
CheckImages.h:118
SourceXtractor::CheckImages::m_aperture_filename
boost::filesystem::path m_aperture_filename
Definition:
CheckImages.h:186
SourceXtractor::CheckImages::getMoffatImage
std::shared_ptr< WriteableImage< SeFloat > > getMoffatImage() const
Definition:
CheckImages.h:94
SourceXtractor::CheckImages::m_background_image
std::shared_ptr< Image< SeFloat > > m_background_image
Definition:
CheckImages.h:168
SourceXtractor::CheckImages::getModelFittingImage
std::shared_ptr< WriteableImage< MeasurementImage::PixelType > > getModelFittingImage(unsigned int frame_number)
Definition:
CheckImages.cpp:192
SourceXtractor::CheckImages::m_model_fitting_image_filename
boost::filesystem::path m_model_fitting_image_filename
Definition:
CheckImages.h:175
SourceXtractor::CheckImages::setCustomCheckImage
void setCustomCheckImage(std::string id, std::shared_ptr< Image< SeFloat >> image)
Definition:
CheckImages.cpp:63
SourceXtractor::CheckImages::saveImages
void saveImages()
Definition:
CheckImages.cpp:253
SourceXtractor::CheckImages::m_detection_image
std::shared_ptr< DetectionImage > m_detection_image
Definition:
CheckImages.h:167
SourceXtractor::CheckImages::m_measurement_frames
std::map< int, FrameInfo > m_measurement_frames
Definition:
CheckImages.h:192
SourceXtractor::CheckImages::getGroupImage
std::shared_ptr< WriteableImage< int > > getGroupImage() const
Definition:
CheckImages.h:70
SourceXtractor::CheckImages::m_thresholded_image
std::shared_ptr< Image< SeFloat > > m_thresholded_image
Definition:
CheckImages.h:170
SourceXtractor::CheckImages::m_custom_images
std::map< boost::filesystem::path, std::tuple< std::shared_ptr< Image< SeFloat > >, bool > > m_custom_images
Definition:
CheckImages.h:190
SourceXtractor::CheckImages::m_access_mutex
std::mutex m_access_mutex
Definition:
CheckImages.h:194
SourceXtractor::Configurable
Interface of objects which can be configured.
Definition:
Configurable.h:37
SourceXtractor::Image
Interface representing an image.
Definition:
Image.h:43
SourceXtractor::LockedWriteableImage::create
static std::shared_ptr< LockedWriteableImage< T > > create(Args &&... args)
Definition:
LockedWriteableImage.h:25
std::map
std::mutex
SourceXtractor
Definition:
Aperture.h:30
std::shared_ptr
SourceXtractor::CheckImages::FrameInfo
Definition:
CheckImages.h:149
SourceXtractor::CheckImages::FrameInfo::m_coordinate_system
std::shared_ptr< CoordinateSystem > m_coordinate_system
Definition:
CheckImages.h:152
SourceXtractor::CheckImages::FrameInfo::m_label
std::string m_label
Definition:
CheckImages.h:150
SourceXtractor::CheckImages::FrameInfo::m_width
int m_width
Definition:
CheckImages.h:151
SourceXtractor::CheckImages::FrameInfo::m_subtracted_image
std::shared_ptr< DetectionImage > m_subtracted_image
Definition:
CheckImages.h:153
SourceXtractor::CheckImages::FrameInfo::m_height
int m_height
Definition:
CheckImages.h:151
std::unique_ptr
Generated by
1.9.1