IMP  2.4.0
The Integrative Modeling Platform
domino_particle_states.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em2d/domino_particle_states.h
3  * \brief kernel::Particles states for a rigid body that is going to be
4  *projected
5  *
6  * Copyright 2007-2015 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPEM2D_DOMINO_PARTICLE_STATES_H
11 #define IMPEM2D_DOMINO_PARTICLE_STATES_H
12 
13 #include "IMP/em2d/Image.h"
16 #include "IMP/core/rigid_bodies.h"
17 #include "IMP/algebra/Vector3D.h"
18 #include "IMP/algebra/Rotation3D.h"
19 #include "IMP/base/Pointer.h"
20 #include "IMP/base_types.h"
21 #include "IMP/Particle.h"
22 
23 IMPEM2D_BEGIN_NAMESPACE
24 
25 /** States that a set of kernel::Particles can have according to their positions
26  and orientations in a grid. The orientations also determine the orientation
27  of the projections of the particles.
28 */
29 class IMPEM2DEXPORT GridStates : public domino::ParticleStates {
30 
31  protected:
32  algebra::Vector3Ds positions_;
33  algebra::Rotation3Ds orientations_;
34  unsigned int number_of_states_;
35 
36  public:
37  /**
38  \param[in] positions Set of positions that the set of particles
39  can have in the grid (points of the grid).
40  \param[in] orientations Orientations of the particles in in the grid
41  \param[in] name
42  Note: The number of states considered is positions * orientations, as
43  each position can have all orientations.
44  \
45  */
46  GridStates(const algebra::Vector3Ds &positions,
47  const algebra::Rotation3Ds &orientations,
48  const String &name = "GridStates")
49  : domino::ParticleStates(name),
50  positions_(positions),
51  orientations_(orientations) {
52  number_of_states_ = positions_.size() * orientations_.size();
53  };
54 
55  //! Returns the position corresponding to the state i
56  algebra::Vector3D get_position(unsigned int i) const;
57 
58  //! Returns the orientation corresponding to the state i
59  algebra::Rotation3D get_orientation(unsigned int i) const;
60 
61  virtual unsigned int get_number_of_particle_states() const IMP_OVERRIDE;
62  virtual void load_particle_state(unsigned int, kernel::Particle *) const
64 
66 };
68 
69 /** States that a set of kernel::Particles can have according to their positions
70  and orientations in a grid. The orientations also determine the orientation
71  of the projections of the particles.
72 */
73 class IMPEM2DEXPORT ProjectionStates : public GridStates {
74 
75  protected:
76  Images projections_;
77 
78  public:
79  /**
80  \param[in] positions Set of positions that the set of particles
81  can have in the grid (points of the grid).
82  \param[in] orientations Orientations of the particles in in the grid
83  \param[in] projections of the particles in the given orientations.
84  There must be correspondence between the orientations and the
85  projections.
86  \param[in] name
87  \note The number of states considered is positions * orientations, as
88  each position can have all orientations.
89  \
90  */
92  const algebra::Rotation3Ds &orientations,
93  const Images &projections,
94  const String &name = "ProjectionStates")
95  : GridStates(positions, orientations, name), projections_(projections) {
96  number_of_states_ = positions_.size() * orientations_.size();
97  };
98 
99  //! Returns the projection corresponding to the state i;
100  Image *get_projection(unsigned int i) const;
101 
102  virtual unsigned int get_number_of_particle_states() const IMP_OVERRIDE;
103  virtual void load_particle_state(unsigned int, kernel::Particle *) const
104  IMP_OVERRIDE;
105 
107 };
109 
110 IMPEM2D_END_NAMESPACE
111 
112 #endif /* IMPEM2D_DOMINO_PARTICLE_STATES_H */
Import IMP/kernel/base_types.h in the namespace.
#define IMP_OBJECT_NO_WARNING(Name)
Only to work around a gcc bug.
Definition: object_macros.h:38
void get_projection(em2d::Image *img, const kernel::ParticlesTemp &ps, const RegistrationResult &reg, const ProjectingOptions &options, MasksManagerPtr masks=MasksManagerPtr(), String name="")
Generates a projection from particles.
IMP images for Electron Microscopy using openCV matrices Copyright 2007-2015 IMP Inventors. All rights reserved.
functionality for defining rigid bodies
Various important macros for implementing decorators.
Class to handle individual model particles.
Simple 3D rotation class.
ProjectionStates(const algebra::Vector3Ds &positions, const algebra::Rotation3Ds &orientations, const Images &projections, const String &name="ProjectionStates")
3D rotation class.
Definition: Rotation3D.h:46
Import IMP/kernel/Particle.h in the namespace.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Definition: object_macros.h:52
A nullptr-initialized pointer to an IMP Object.
VectorD< 3 > Vector3D
Definition: VectorD.h:395
GridStates(const algebra::Vector3Ds &positions, const algebra::Rotation3Ds &orientations, const String &name="GridStates")
Simple 3D vector class.
A Bayesian inference-based sampler.
std::string String
Basic string value.
Definition: types.h:44
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
2D Electron Microscopy images in IMP
Definition: Image.h:27