8 #ifndef IMPEM2D_PROJECTION_FINDER_H
9 #define IMPEM2D_PROJECTION_FINDER_H
11 #include "IMP/em2d/em2d_config.h"
28 IMPEM2D_BEGIN_NAMESPACE
32 const unsigned int ALIGN2D_PREPROCESSING = 1;
33 const unsigned int ALIGN2D_WITH_CENTERS = 2;
37 void init_defaults() {
38 coarse_registration_method = ALIGN2D_PREPROCESSING;
39 save_match_images =
false;
40 optimization_steps = 5;
41 simplex_initial_length = 0.1;
42 simplex_minimum_size = 0.01;
47 unsigned int n_projections;
48 unsigned int coarse_registration_method;
49 bool save_match_images;
50 unsigned int optimization_steps;
51 double simplex_initial_length;
52 double simplex_minimum_size;
54 Em2DRestraintParameters() {
58 Em2DRestraintParameters(
double ps,
double res,
unsigned int n_proj = 20)
63 void show(std::ostream &out = std::cout)
const {
64 out <<
"Em2DRestraintParameters: " << std::endl <<
"pixel_size "
65 << pixel_size <<
" resolution " << resolution
66 <<
" coarse_registration_method " << coarse_registration_method
67 <<
" optimization_steps " << optimization_steps
68 <<
" simplex_initial_length " << simplex_initial_length
69 <<
" simplex_minimum_size " << simplex_minimum_size << std::endl;
78 :
Object(
"ProjectionFinder%1%"),
79 parameters_setup_(
false),
80 registration_done_(
false) {};
84 const Em2DRestraintParameters ¶ms) {
86 score_function_ = score_function;
90 masks_manager_->setup_kernel(params.resolution, params.pixel_size);
91 fast_optimization_mode_ =
false;
92 parameters_setup_ =
true;
93 preprocessing_time_ = 0.0;
94 coarse_registration_time_ = 0.0;
95 fine_registration_time_ = 0.0;
105 void set_variance_images(
const em2d::Images &variances);
118 bool get_save_match_images()
const {
return params_.save_match_images; }
124 void set_fast_mode(
unsigned int n);
136 void get_coarse_registration();
140 void get_complete_registration();
146 void show(std::ostream &out)
const;
149 double get_preprocessing_time()
const;
152 double get_coarse_registration_time()
const;
155 double get_fine_registration_time()
const;
157 unsigned int get_number_of_subjects()
const {
return subjects_.size(); }
159 void set_number_of_class_averages_members(
Ints n_members) {
160 n_members_ = n_members;
163 unsigned int get_number_of_projections()
const {
return projections_.size(); }
168 double preprocessing_time_, coarse_registration_time_,
169 fine_registration_time_;
171 void get_coarse_registrations_for_subject(
unsigned int i,
174 void do_preprocess_projection(
unsigned int j);
175 void do_preprocess_subject(
unsigned int i);
179 void do_preprocess_for_fast_coarse_registration(
const cv::Mat &m,
181 cv::Mat &POLAR_AUTOC);
191 bool particles_set_, parameters_setup_, registration_done_,
192 fast_optimization_mode_;
194 unsigned int number_of_optimized_projections_;
196 std::vector<cv::Mat> SUBJECTS_;
198 std::vector<cv::Mat> SUBJECTS_POLAR_AUTOC_;
199 std::vector<cv::Mat> PROJECTIONS_POLAR_AUTOC_;
204 Em2DRestraintParameters params_;
213 IMPEM2D_END_NAMESPACE
Generation of projections from models or density maps Copyright 2007-2014 IMP Inventors. All rights reserved.
void set_save_match_images(bool x)
Classes and operations related with rotations.
projection masks Copyright 2007-2014 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-2014 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-2014 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-2014 IMP Inventors. All rights reserved.
Scoring functions for 2D Copyright 2007-2014 IMP Inventors. All rights reserved.
Object(std::string name)
Construct an object with the given name.
IMP::base::Vector< RegistrationResult > RegistrationResults
Base class for all scoring functions related to em2d.
Funtions related with rotations in em2d Copyright 2007-2014 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-2014 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.