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;
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):
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) {};
86 const Em2DRestraintParameters ¶ms) {
88 score_function_= score_function;
92 masks_manager_->setup_kernel(params.resolution,params.pixel_size);
93 fast_optimization_mode_ =
false;
94 parameters_setup_=
true;
95 preprocessing_time_=0.0;
96 coarse_registration_time_=0.0;
97 fine_registration_time_ =0.0;
108 void set_variance_images(
const em2d::Images &variances);
121 params_.save_match_images = x;
124 bool get_save_match_images()
const {
125 return params_.save_match_images;
132 void set_fast_mode(
unsigned int n);
144 void get_coarse_registration();
148 void get_complete_registration();
154 void show(std::ostream &out)
const;
157 double get_preprocessing_time()
const;
160 double get_coarse_registration_time()
const;
163 double get_fine_registration_time()
const;
165 unsigned int get_number_of_subjects()
const {
166 return subjects_.size();
169 void set_number_of_class_averages_members(
Ints n_members) {
170 n_members_ = n_members;
173 unsigned int get_number_of_projections()
const {
174 return projections_.size();
181 double preprocessing_time_,coarse_registration_time_,fine_registration_time_;
183 void get_coarse_registrations_for_subject(
unsigned int i,
186 void do_preprocess_projection(
unsigned int j);
187 void do_preprocess_subject(
unsigned int i);
191 void do_preprocess_for_fast_coarse_registration(
const cv::Mat &m,
193 cv::Mat &POLAR_AUTOC);
206 fast_optimization_mode_;
209 unsigned int number_of_optimized_projections_;
211 std::vector< cv::Mat > SUBJECTS_;
213 std::vector< cv::Mat > SUBJECTS_POLAR_AUTOC_;
214 std::vector< cv::Mat > PROJECTIONS_POLAR_AUTOC_;
219 Em2DRestraintParameters params_;
228 IMPEM2D_END_NAMESPACE
Generation of projections from models or density maps Copyright 2007-2013 IMP Inventors. All rights reserved.
void set_save_match_images(bool x)
Classes and operations related with rotations.
projection masks Copyright 2007-2013 IMP Inventors. All rights reserved.
A nullptr-initialized pointer to an IMP Object.
void set_was_used(bool tf) const
Alignment of images in 2D Copyright 2007-2013 IMP Inventors. All rights reserved. ...
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
A smart pointer to a reference counted object.
inteface with OpenCV Copyright 2007-2013 IMP Inventors. All rights reserved.
const unsigned int ALIGN2D_NO_PREPROCESSING
Methods for registration used by the finder.
IMP images for Electron Microscopy using openCV matrices Copyright 2007-2013 IMP Inventors. All rights reserved.
Scoring functions for 2D Copyright 2007-2013 IMP Inventors. All rights reserved.
IMP::base::Vector< RegistrationResult > RegistrationResults
Base class for all scoring functions related to em2d.
Funtions related with rotations in em2d Copyright 2007-2013 IMP Inventors. All rights reserved...
em2d::Images subjects_
Main parameters.
void setup(ScoreFunction *score_function, const Em2DRestraintParameters ¶ms)
Initializes the parameters to generate and match projections.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Common base class for heavy weight IMP objects.
Simple 3D rotation class.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Parameters needed for the core projection routine.
Import IMP/kernel/Particle.h in the namespace.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
void show(std::ostream &out=std::cout) const
MasksManagerPtr masks_manager_
double get_global_score(const RegistrationResults &RRs)
Registration results class Copyright 2007-2013 IMP Inventors. All rights reserved.
class to perform registration of model projections to images images
Manage of projection masks.
IMP::base::Vector< Int > Ints
Standard way to pass a bunch of Int values.