IMP  2.2.1
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-2014 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  \param[in] i
57  */
58  algebra::Vector3D get_position(unsigned int i) const;
59 
60  /*! Returns the orientation corresponding to the state i
61  \param[in] i
62  */
63  algebra::Rotation3D get_orientation(unsigned int i) const;
64 
65  virtual unsigned int get_number_of_particle_states() const IMP_OVERRIDE;
66  virtual void load_particle_state(unsigned int, kernel::Particle *) const
67  IMP_OVERRIDE;
68 
70 };
72 
73 /*! States that a set of kernel::Particles can have according to their positions
74  and orientations in a grid. The orientations also determine the orientation
75  of the projections of the particles.
76 */
77 class IMPEM2DEXPORT ProjectionStates : public GridStates {
78 
79  protected:
80  Images projections_;
81 
82  public:
83  /*!
84  \param[in] positions Set of positions that the set of particles
85  can have in the grid (points of the grid).
86  \param[in] orientations Orientations of the particles in in the grid
87  \param[in] projections of the particles in the given orientations.
88  There must be correspondence between the orientations and the
89  projections.
90  \param[in] name
91  \note The number of states considered is positions * orientations, as
92  each position can have all orientations.
93  \
94  */
96  const algebra::Rotation3Ds &orientations,
97  const Images &projections,
98  const String &name = "ProjectionStates")
99  : GridStates(positions, orientations, name), projections_(projections) {
100  number_of_states_ = positions_.size() * orientations_.size();
101  };
102 
103  /*! Returns the projection corresponding to the state i;
104  \param[in] i
105  */
106  Image *get_projection(unsigned int i) const;
107 
108  virtual unsigned int get_number_of_particle_states() const IMP_OVERRIDE;
109  virtual void load_particle_state(unsigned int, kernel::Particle *) const
110  IMP_OVERRIDE;
111 
113 };
115 
116 IMPEM2D_END_NAMESPACE
117 
118 #endif /* IMPEM2D_DOMINO_PARTICLE_STATES_H */
Import IMP/kernel/base_types.h in the namespace.
A nullptr-initialized pointer to an IMP Object.
#define IMP_OBJECT_NO_WARNING(Name)
Only to work around a gcc bug.
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-2014 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")
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
3D rotation class.
Definition: Rotation3D.h:46
Import IMP/kernel/Particle.h in the namespace.
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 beyesian infererence-based sampler.
std::string String
Basic string value.
Definition: base/types.h:44
2D Electron Microscopy images in IMP
Definition: Image.h:27