IMP  2.1.1
The Integrative Modeling Platform
domino_particle_states.h
Go to the documentation of this file.
1 /**
2  * \file domino_particle_states.h
3  * \brief kernel::Particles states for a rigid body that is going to be projected
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM2D_DOMINO_PARTICLE_STATES_H
10 #define IMPEM2D_DOMINO_PARTICLE_STATES_H
11 
12 #include "IMP/em2d/Image.h"
15 #include "IMP/core/rigid_bodies.h"
16 #include "IMP/algebra/Vector3D.h"
17 #include "IMP/algebra/Rotation3D.h"
18 #include "IMP/base/Pointer.h"
19 #include "IMP/base_types.h"
20 #include "IMP/Particle.h"
21 
22 IMPEM2D_BEGIN_NAMESPACE
23 
24 
25 
26 /*! States that a set of kernel::Particles can have according to their positions
27  and orientations in a grid. The orientations also determine the orientation
28  of the projections of the particles.
29 */
30 class IMPEM2DEXPORT GridStates: public domino::ParticleStates {
31 
32 protected:
33 
34  algebra::Vector3Ds positions_;
35  algebra::Rotation3Ds orientations_;
36  unsigned int number_of_states_;
37 
38 public:
39 
40 
41  /*!
42  \param[in] positions Set of positions that the set of particles
43  can have in the grid (points of the grid).
44  \param[in] orientations Orientations of the particles in in the grid
45  \param[in] name
46  Note: The number of states considered is positions * orientations, as
47  each position can have all orientations.
48  \
49  */
50  GridStates(const algebra::Vector3Ds &positions,
51  const algebra::Rotation3Ds &orientations,
52  const String &name="GridStates") :
53  domino::ParticleStates(name),
54  positions_(positions),
55  orientations_(orientations) {
56  number_of_states_ = positions_.size()*orientations_.size();
57  };
58 
59  /*! Returns the position corresponding to the state i
60  \param[in] i
61  */
62  algebra::Vector3D get_position(unsigned int i) const;
63 
64  /*! Returns the orientation corresponding to the state i
65  \param[in] i
66  */
67  algebra::Rotation3D get_orientation(unsigned int i) const;
68 
70 
71  };
73 
74 
75 /*! States that a set of kernel::Particles can have according to their positions
76  and orientations in a grid. The orientations also determine the orientation
77  of the projections of the particles.
78 */
79 class IMPEM2DEXPORT ProjectionStates: public GridStates {
80 
81 protected:
82 
83  Images projections_;
84 
85 public:
86 
87 
88  /*!
89  \param[in] positions Set of positions that the set of particles
90  can have in the grid (points of the grid).
91  \param[in] orientations Orientations of the particles in in the grid
92  \param[in] projections of the particles in the given orientations.
93  There must be correspondence between the orientations and the
94  projections.
95  \param[in] name
96  \note The number of states considered is positions * orientations, as
97  each position can have all orientations.
98  \
99  */
101  const algebra::Rotation3Ds &orientations,
102  const Images &projections,
103  const String &name="ProjectionStates") :
104  GridStates(positions, orientations, name),
105  projections_(projections) {
106  number_of_states_ = positions_.size()*orientations_.size();
107  };
108 
109  /*! Returns the projection corresponding to the state i;
110  \param[in] i
111  */
112  Image* get_projection(unsigned int i) const;
113 
115  };
117 
118 
119 
120 
121 
122 IMPEM2D_END_NAMESPACE
123 
124 #endif /* IMPEM2D_DOMINO_PARTICLE_STATES_H */
Import IMP/kernel/base_types.h in the namespace.
A nullptr-initialized pointer to an IMP Object.
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-2013 IMP Inventors. All rights reserved.
functionality for defining rigid bodies
Various important macros for implementing decorators.
#define IMP_PARTICLE_STATES(Name)
Definition: domino_macros.h:16
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:45
Import IMP/kernel/Particle.h in the namespace.
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:32