10#ifndef IMPEM2D_PCA_FIT_RESTRAINT_H
11#define IMPEM2D_PCA_FIT_RESTRAINT_H
13#include <IMP/em2d/em2d_config.h>
14#include <IMP/em2d/internal/Image2D.h>
15#include <IMP/em2d/internal/Projector.h>
19IMPEM2D_BEGIN_NAMESPACE
52 const std::vector<std::string>& image_files,
53 double pixel_size,
double resolution = 10.0,
54 unsigned int projection_number = 100,
55 bool reuse_direction =
false,
56 unsigned int n_components = 1,
57 unsigned int micrographs_number = 0);
62 unsigned int get_projection_number()
const {
return projection_number_; }
64 void set_projection_number(
unsigned int n) { projection_number_ = n; }
66 unsigned int get_micrographs_number()
const {
return micrographs_number_; }
68 void set_micrographs_number(
unsigned int n) { micrographs_number_ = n; }
89 void write_best_projections(std::string file_name,
bool evaluate=
false);
105 std::vector<internal::Image2D<>> images_;
117 unsigned int projection_number_;
120 mutable std::vector<internal::Image2D<>> best_projections_;
123 mutable std::vector<internal::ProjectionInfo> best_projections_info_;
125 mutable std::vector<internal::ImageTransform> best_image_transform_;
128 internal::Projector projector_;
131 bool reuse_direction_;
134 unsigned int n_components_;
136 unsigned int micrographs_number_;
137 mutable unsigned long counter_;
Abstract base class for all restraints.
Class for adding derivatives from restraints to the model.
Report key:value information on restraints.
A restraint is a term in an IMP ScoringFunction.
double evaluate(bool calc_derivs) const
IMP::ModelObjectsTemp do_get_inputs() const override
double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
double get_cross_correlation_coefficient(unsigned int image_number) const
Get cross correlation between the image and the best model projection.
RestraintInfo * get_static_info() const override
RestraintInfo * get_dynamic_info() const override
algebra::Transformation3D get_transformation(unsigned int image_number) const
Get transformation that best places the model on the image.
PCAFitRestraint(Particles particles, const std::vector< std::string > &image_files, double pixel_size, double resolution=10.0, unsigned int projection_number=100, bool reuse_direction=false, unsigned int n_components=1, unsigned int micrographs_number=0)
Constructor.
Vector< VectorD< 3 > > Vector3Ds
Vector< Pointer< Particle > > Particles
A list of reference-counted Particle objects.
IMP::Vector< String > Strings
Standard way to pass a bunch of String values.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.