IMP  2.0.1
The Integrative Modeling Platform
DensityDataPoints.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/DensityDataPoints.h
3  * \brief Handling of data for anchor points segmentation
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_DENSITY_DATA_POINTS_H
10 #define IMPMULTIFIT_DENSITY_DATA_POINTS_H
11 
12 #include <IMP/base_types.h>
13 #include <IMP/Particle.h>
15 #include <IMP/statistics/internal/random_generator.h>
16 #include <IMP/statistics/internal/DataPoints.h>
17 #include <IMP/em/converters.h>
18 #include <IMP/em/DensityMap.h>
19 #include <IMP/algebra/Vector3D.h>
20 #include <IMP/algebra/internal/tnt_array2d.h>
21 #include <IMP/algebra/internal/tnt_array2d_utils.h>
22 #include <IMP/atom/Hierarchy.h>
23 #include <boost/scoped_ptr.hpp>
24 #include <IMP/multifit/multifit_config.h>
25 #include <map>
26 
27 IMPMULTIFIT_BEGIN_NAMESPACE
28 typedef IMP::algebra::DenseGrid3D<double> DensGrid;
29 
30 IMPMULTIFITEXPORT
31 em::DensityMap *grid2map(const DensGrid &dg,float spacing);
32 
33 
34 //! Stores density voxels as a vector of Array1D.
35 /**
36 \note This manipulation is needed for matrix operations.
37  */
38 class IMPMULTIFITEXPORT DensityDataPoints
39  : public IMP::statistics::internal::XYZDataPoints
40 {
41  public:
43  float density_threshold);
44  DensityDataPoints(const DensGrid &dens,
45  float density_threshold);
46  IMP::statistics::internal::Array1DD sample() const;
47 
48  // em::DensityMap* get_density_map() const {return dens_;}
49 
51  { out << "DensityDataPoints" << std::endl; }, {});
52  protected:
53  void populate_data();
54  void set_max_min_density_values();
55  void set_density(em::DensityMap *d);
56  void set_density(const DensGrid &dens);
57  //TODO - change back once DensityMap will be Grid3D
58  //Pointer<DensGrid> dens_; /// TODO - make the class an object
59  boost::scoped_ptr<DensGrid> dens_;
60  // em::DensityMap *dens_;
61  double max_value_,min_value_;
62  double threshold_;
63 };
65 
66 IMPMULTIFIT_END_NAMESPACE
67 
68 #endif /* IMPMULTIFIT_DENSITY_DATA_POINTS_H */