PSFEstimationwithCPSO
|
00001 /* 00002 * psf_estimator.hpp 00003 * 00004 * Created on: 16/07/2012 00005 * Author: Peter Frank Perroni (pfperroni@inf.ufpr.br) 00006 */ 00007 00008 #ifndef _PSF_ESTIMATOR_HPP_ 00009 #define _PSF_ESTIMATOR_HPP_ 00010 00011 #include <ctime> 00012 #include "cl_factory.hpp" 00013 #include "cpso.hpp" 00014 #include "Profiling.hpp" 00015 00022 class PsfEstimator{ 00023 static CPSO **cpso_pool; 00024 static bool *cpso_in_use; 00025 static int cpso_pool_size; 00026 static omp_lock_t mutex; 00027 00028 static double *zernikes; 00029 static int *phase_mask, *diffraction_mask; 00030 static int phase_size, image_size, n_zernikes, psf_range, n_particles, n_swarms; 00031 static WORD w, c1, c2, reset_at; 00032 00033 static CPSO* getCPSO_internal(double *object, double *image, WORD *startp_coefs); 00034 00035 public: 00036 static void startup(int _cpso_pool_size, double* _zernikes, int *_phase_mask, int *_diffraction_mask, 00037 int _phase_size, int _image_size, int _n_zernikes, int _psf_range, WORD _w, WORD _c1, WORD _c2, 00038 WORD _reset_at, int _n_particles, int _n_swarms, vector<int> *_devices); 00039 00040 static void resetPool(WORD _w, WORD _c1, WORD _c2, WORD _reset_at, int _n_particles, int _n_swarms); 00041 00042 static void shutdown(); 00043 00044 static CPSO* getCPSO(double *object, double *image); 00045 00046 static CPSO* getCPSO(double *object, double *image, WORD *startp_coefs); 00047 }; 00048 00049 #endif /* _PSF_ESTIMATOR_HPP_ */