IMP  2.2.0
The Integrative Modeling Platform
CollisionCrossSection.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em2d/CollisionCrossSection.h
3  * \brief
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM2D_COLLISION_CROSS_SECTION_H
10 #define IMPEM2D_COLLISION_CROSS_SECTION_H
11 
14 #include "IMP/em2d/project.h"
15 #include "IMP/macros.h"
16 #include "IMP/Particle.h"
17 
18 IMPEM2D_BEGIN_NAMESPACE
19 
20 //! Determine the collision cross section for some projections of particles
21 class IMPEM2DEXPORT CollisionCrossSection : public IMP::base::Object {
22  public:
23  /*!
24  \param[in] n_projections Number of projections to use for obtaining the CCS
25  \param[in] resolution "Resolution" to use to generate the projections.
26  \param[in] pixel_size size in A/pix to use when generating the projections
27  \param[in] projection_image_size The size of the projections to generate;
28  for this value you should request a size so that
29  pixel_size * projection_image_size >= Max distance between two
30  particles.
31  */
32  CollisionCrossSection(unsigned int n_projections, double resolution,
33  double pixel_size, double projection_image_size);
34 
35  /**
36  * kernel::Particles used to calculate their collision cross section
37  * @param ps The particles
38  */
39  void set_model_particles(const kernel::ParticlesTemp &ps);
40 
41  /**
42  * Returns the collision cross section. Before using this function you need
43  * to set the particles with set_model_particles()
44  * @return The value of the collision cross section
45  */
46  double get_ccs() const;
47 
48  /**
49  * Shows information about the class
50  * @param out Stream used to show the information
51  */
52  void show(std::ostream &out) const {
53  out << "Collision Cross section." << std::endl;
54  }
56 
57  protected:
58  /*! Gets the sum of the values in the pixels with value > 0
59  \param[in] m The projected area is computed for this matrix
60  \return Values of the area
61  */
62  double get_projected_area(const cv::Mat &m) const;
63 
64  unsigned int n_projections_;
65  double resolution_;
66  double pixel_size_;
67  unsigned int img_size_;
68  bool particles_set_;
70  cv::Mat average_projection_;
71  em2d::MasksManagerPtr masks_manager_;
72  double collision_cross_section_;
73 };
75 
76 IMPEM2D_END_NAMESPACE
77 
78 #endif /* IMPEM2D_COLLISION_CROSS_SECTION_H */
Generation of projections from models or density maps Copyright 2007-2014 IMP Inventors. All rights reserved.
projection masks Copyright 2007-2014 IMP Inventors. All rights reserved.
void show(std::ostream &out) const
Import IMP/kernel/macros.h in the namespace.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Common base class for heavy weight IMP objects.
Definition: base/Object.h:106
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Import IMP/kernel/Particle.h in the namespace.
Determine the collision cross section for some projections of particles.
Registration results class Copyright 2007-2014 IMP Inventors. All rights reserved.