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