8 #ifndef IMPEM2D_PROJECTION_FINDER_H
9 #define IMPEM2D_PROJECTION_FINDER_H
11 #include "IMP/em2d/em2d_config.h"
28 IMPEM2D_BEGIN_NAMESPACE
33 const unsigned int ALIGN2D_PREPROCESSING = 1;
34 const unsigned int ALIGN2D_WITH_CENTERS = 2;
37 class IMPEM2DEXPORT Em2DRestraintParameters:
public ProjectingParameters {
39 void init_defaults() {
40 coarse_registration_method = ALIGN2D_PREPROCESSING;
41 save_match_images =
false;
42 optimization_steps = 5;
43 simplex_initial_length = 0.1;
44 simplex_minimum_size = 0.01;
50 unsigned int n_projections;
51 unsigned int coarse_registration_method;
52 bool save_match_images;
53 unsigned int optimization_steps;
54 double simplex_initial_length;
55 double simplex_minimum_size;
57 Em2DRestraintParameters() {init_defaults();};
59 Em2DRestraintParameters(
double ps,
double res,
unsigned int n_proj=20):
60 ProjectingParameters(ps, res), n_projections(n_proj) {
64 void show(std::ostream &out = std::cout)
const {
65 out <<
"Em2DRestraintParameters: " << std::endl
66 <<
"pixel_size " << pixel_size <<
" resolution " << resolution
67 <<
" coarse_registration_method " << coarse_registration_method
68 <<
" optimization_steps " << optimization_steps
69 <<
" simplex_initial_length " << simplex_initial_length
70 <<
" simplex_minimum_size " << simplex_minimum_size << std::endl;};
82 parameters_setup_(
false),registration_done_(
false) {};
103 const Em2DRestraintParameters ¶ms) {
105 score_function_= score_function;
109 masks_manager_->setup_kernel(params.resolution,params.pixel_size);
110 fast_optimization_mode_ =
false;
111 parameters_setup_=
true;
112 preprocessing_time_=0.0;
113 coarse_registration_time_=0.0;
114 fine_registration_time_ =0.0;
125 void set_variance_images(
const em2d::Images &variances);
129 void set_model_particles(
const ParticlesTemp &ps);
138 params_.save_match_images = x;
141 bool get_save_match_images()
const {
142 return params_.save_match_images;
149 void set_fast_mode(
unsigned int n);
161 void get_coarse_registration();
165 void get_complete_registration();
171 void show(std::ostream &out)
const;
174 double get_preprocessing_time()
const;
177 double get_coarse_registration_time()
const;
180 double get_fine_registration_time()
const;
182 unsigned int get_number_of_subjects()
const {
183 return subjects_.size();
186 void set_number_of_class_averages_members(
Ints n_members) {
187 n_members_ = n_members;
190 unsigned int get_number_of_projections()
const {
191 return projections_.size();
198 double preprocessing_time_,coarse_registration_time_,fine_registration_time_;
200 void get_coarse_registrations_for_subject(
unsigned int i,
203 void do_preprocess_projection(
unsigned int j);
204 void do_preprocess_subject(
unsigned int i);
208 void do_preprocess_for_fast_coarse_registration(
const cv::Mat &m,
210 cv::Mat &POLAR_AUTOC);
216 ParticlesTemp model_particles_;
218 Pointer<ScoreFunction> score_function_;
223 fast_optimization_mode_;
226 unsigned int number_of_optimized_projections_;
228 std::vector< cv::Mat > SUBJECTS_;
230 std::vector< cv::Mat > SUBJECTS_POLAR_AUTOC_;
231 std::vector< cv::Mat > PROJECTIONS_POLAR_AUTOC_;
236 Em2DRestraintParameters params_;
245 IMPEM2D_END_NAMESPACE