IMP logo
IMP Reference Guide  2.7.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 Particles states for a rigid body that is going to be
4  *projected
5  *
6  * Copyright 2007-2017 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/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 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, Particle *) const
64 
66 };
68 
69 /** States that a set of 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, Particle *) const
104  IMP_OVERRIDE;
105 
107 };
109 
110 IMPEM2D_END_NAMESPACE
111 
112 #endif /* IMPEM2D_DOMINO_PARTICLE_STATES_H */
Basic types used by IMP.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
IMP images for Electron Microscopy using openCV matrices Copyright 2007-2017 IMP Inventors. All rights reserved.
functionality for defining rigid bodies
Various important macros for implementing decorators.
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
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
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.
Class to handle individual particles of a Model object.
Definition: Particle.h:41
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
void get_projection(em2d::Image *img, const ParticlesTemp &ps, const RegistrationResult &reg, const ProjectingOptions &options, MasksManagerPtr masks=MasksManagerPtr(), String name="")
Generates a projection from particles.