9 #ifndef IMPEM2D_RIGID_BODIES_IMAGE_FIT_RESTRAINT_H
10 #define IMPEM2D_RIGID_BODIES_IMAGE_FIT_RESTRAINT_H
22 IMPEM2D_BEGIN_NAMESPACE
29 bool operator()(
const Ints &a,
const Ints &b)
const {
30 for (
unsigned int i=0; i < a.size(); ++i) {
31 if(a[i] < b[i])
return true;
32 if(a[i] > b[i])
return false;
38 typedef std::pair< Ints, unsigned int > KeyIndexPair;
39 typedef std::map< Ints, unsigned int, IntsOrder> KeyIndexMap;
40 typedef std::vector< KeyIndexMap > KeyIndexMaps;
44 class IMPEM2DEXPORT RigidBodiesImageFitRestraint:
public Restraint {
49 std::vector<em2d::Images> rigid_bodies_masks_;
51 Pointer<ScoreFunction> score_function_;
52 core::RigidBodies rigid_bodies_;
53 Pointer<Image> image_;
54 Pointer<Image> projection_;
55 ProjectingParameters params_;
59 unsigned int get_rigid_body_index(
const core::RigidBody &rb)
const;
68 RigidBodiesImageFitRestraint(ScoreFunction *scf,
69 const core::RigidBodies &rbs,
73 void set_projecting_parameters(
const ProjectingParameters &p);
79 void set_orientations(
const core::RigidBody &rb,
86 unsigned int get_number_of_masks(
const core::RigidBody &rb)
const;