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;
38 void init_defaults() {
39 coarse_registration_method = ALIGN2D_PREPROCESSING;
40 save_match_images =
false;
41 optimization_steps = 5;
42 simplex_initial_length = 0.1;
43 simplex_minimum_size = 0.01;
49 unsigned int coarse_registration_method;
50 bool save_match_images;
51 unsigned int optimization_steps;
52 double simplex_initial_length;
53 double simplex_minimum_size;
64 void show(std::ostream &out = std::cout)
const {
65 out <<
"Em2DRestraintParameters: " << std::endl <<
"pixel_size "
66 << 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;
79 :
Object(
"ProjectionFinder%1%"),
80 parameters_setup_(
false),
81 registration_done_(
false) {};
87 score_function_ = score_function;
91 masks_manager_->setup_kernel(params.resolution, params.pixel_size);
92 fast_optimization_mode_ =
false;
93 parameters_setup_ =
true;
94 preprocessing_time_ = 0.0;
95 coarse_registration_time_ = 0.0;
96 fine_registration_time_ = 0.0;
106 void set_variance_images(
const em2d::Images &variances);
119 bool get_save_match_images()
const {
return params_.save_match_images; }
125 void set_fast_mode(
unsigned int n);
137 void get_coarse_registration();
141 void get_complete_registration();
147 void show(std::ostream &out)
const;
150 double get_preprocessing_time()
const;
153 double get_coarse_registration_time()
const;
156 double get_fine_registration_time()
const;
158 unsigned int get_number_of_subjects()
const {
return subjects_.size(); }
160 void set_number_of_class_averages_members(
Ints n_members) {
161 n_members_ = n_members;
164 unsigned int get_number_of_projections()
const {
return projections_.size(); }
169 double preprocessing_time_, coarse_registration_time_,
170 fine_registration_time_;
172 void get_coarse_registrations_for_subject(
unsigned int i,
175 void do_preprocess_projection(
unsigned int j);
176 void do_preprocess_subject(
unsigned int i);
180 void do_preprocess_for_fast_coarse_registration(
const cv::Mat &m,
182 cv::Mat &POLAR_AUTOC);
192 bool particles_set_, parameters_setup_, registration_done_,
193 fast_optimization_mode_;
195 unsigned int number_of_optimized_projections_;
197 std::vector<cv::Mat> SUBJECTS_;
199 std::vector<cv::Mat> SUBJECTS_POLAR_AUTOC_;
200 std::vector<cv::Mat> PROJECTIONS_POLAR_AUTOC_;
214 IMPEM2D_END_NAMESPACE
Generation of projections from models or density maps Copyright 2007-2016 IMP Inventors. All rights reserved.
void set_save_match_images(bool x)
Classes and operations related with rotations.
projection masks Copyright 2007-2016 IMP Inventors. All rights reserved.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Alignment of images in 2D Copyright 2007-2016 IMP Inventors. All rights reserved. ...
Interface with OpenCV Copyright 2007-2016 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-2016 IMP Inventors. All rights reserved.
A smart pointer to a reference counted object.
Scoring functions for 2D Copyright 2007-2016 IMP Inventors. All rights reserved.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Common base class for heavy weight IMP objects.
Base class for all scoring functions related to em2d.
Functions related with rotations in em2d Copyright 2007-2016 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.
IMP::Vector< RegistrationResult > RegistrationResults
Simple 3D rotation class.
Parameters needed for the core projection routine.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
A nullptr-initialized pointer to an IMP Object.
Parameters used by Em2DRestraint and ProjectionFinder.
unsigned int n_projections
Number of model projections to generate when scoring.
Object(std::string name)
Construct an object with the given name.
void show(std::ostream &out=std::cout) const
MasksManagerPtr masks_manager_
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.
double get_global_score(const RegistrationResults &RRs)
Registration results class Copyright 2007-2016 IMP Inventors. All rights reserved.
Class to perform registration of model projections to images.
Management of projection masks.
void set_was_used(bool tf) const