19 #pragma warning(disable : 4005 4333 34)
24 #define _USE_MATH_DEFINES
41 #include "tinycolormap.hpp"
45 #include "MerlinInterface.h"
46 #include "TimepixInterface.h"
50 namespace chc = std::chrono;
133 void compute_detector(
int nx_cam,
int ny_cam, std::array<float, 2> &offset);
171 std::vector<float> cbed_log;
174 std::mutex ricom_mutex;
175 std::mutex stem_mutex;
176 std::mutex counter_mutex;
177 std::mutex e_field_mutex;
181 template <
typename T>
182 inline void update_surfaces(
int iy, std::vector<T> *p_frame);
183 void reinit_vectors_limits();
186 void calculate_update_list();
187 inline void rescales_recomputes();
188 template <
typename T,
class CameraInterface>
190 template <
typename T>
191 inline void swap_endianess(T &val);
194 inline void icom(std::array<float, 2> *com,
int x,
int y);
195 inline void icom(std::array<float, 2> com,
int x,
int y);
196 template <
typename T>
197 inline void com(std::vector<T> *data, std::array<float, 2> &com);
198 template <
typename T>
199 void read_com_merlin(std::vector<T> &data, std::array<float, 2> &com);
200 inline void set_ricom_pixel(
int idx,
int idy);
201 template <
typename T>
202 inline void com_icom(std::vector<T> data,
int ix,
int iy, std::array<float, 2> *com_xy_sum,
ProgressMonitor *
p_prog_mon);
203 template <
typename T>
204 inline void com_icom(std::vector<T> *p_data,
int ix,
int iy, std::array<float, 2> *com_xy_sum,
ProgressMonitor *
p_prog_mon);
207 template <
typename T>
208 inline void stem(std::vector<T> *data,
size_t id_stem);
209 inline void set_stem_pixel(
size_t idx,
size_t idy);
212 inline void compute_electric_field(std::array<float, 2> &p_com_xy,
size_t id);
213 inline void set_e_field_pixel(
size_t idx,
size_t idy);
279 template <
class CameraInterface>
282 template <
typename T>
284 template <
typename T,
class CameraInterface>
286 template <
class CameraInterface>
std::array< float, 2 > radius2
std::array< float, 2 > radius
std::vector< int > id_list
void compute_detector(int nx_cam, int ny_cam, std::array< float, 2 > &offset)
std::vector< float > kernel_x
std::vector< float > kernel_y
std::vector< float > f_approx
void approximate_frequencies(size_t n_im)
std::array< int, 2 > kernel_filter_frequency
std::vector< float > kernel_filter
std::vector< int > fftshift_map(int x, int y)
std::array< float, 2 > com_public
bool b_recompute_detector
std::vector< float > stem_data
void draw_e_field_image()
std::vector< float > ricom_data
std::atomic< bool > rescale_ricom
std::vector< std::complex< float > > e_field_data
void run_reconstruction(RICOM::modes mode)
std::vector< float > com_map_x
ProgressMonitor * p_prog_mon
enum CAMERA::Camera_model select_mode_by_file(const char *filename)
void plot_cbed(std::vector< T > *p_data)
std::vector< float > com_map_y
CAMERA::Camera_BASE camera
void process_data(CAMERA::Camera< CameraInterface, CAMERA::FRAME_BASED > *camera)
std::atomic< bool > rescale_e_mag
std::array< float, 2 > offset
std::atomic< bool > rescale_stem
void init(Ricom_kernel kernel, int nx_ricom, int ny_ricom)
std::vector< id_x_y > ids
void shift(id_x_y &id_sft, int id, int shift)
void run_connection_script(Ricom *r, MerlinSettings *merlin, const std::string &python_path)
void run_ricom(Ricom *r, RICOM::modes mode)