IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/22
The Integrative Modeling Platform
CoarseConvolution.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em/CoarseConvolution.h
3  * \brief Convolutes two grids
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM_COARSE_CONVOLUTION_H
10 #define IMPEM_COARSE_CONVOLUTION_H
11 
12 #include <IMP/em/em_config.h>
13 #include "exp.h"
14 #include "DensityMap.h"
15 #include "SampledDensityMap.h"
16 #include "def.h"
17 #include <vector>
18 
19 IMPEM_BEGIN_NAMESPACE
20 
21 //! Convolutes two grids
22 /** The pixels involved are derived from the positions of N particles.
23  */
24 class IMPEMEXPORT CoarseConvolution {
25 
26  public:
27 #if 0
28  //! Evaluates the convolution between two density grids
29  /**
30  f*g(n)=f(m)g(n-m); m runs between -inf to inf
31  \param[in] f A DensityMap. note:
32  correct RMSD and mean MUST be in the header!
33  \param[in] g a sampled density map of particles
34  \param[in] g_ps particles data (location, radii, weight)
35  \param[in] dvx vector to contain the x partial derivatives for g_access_p
36  \param[in] dvy vector to contain the y partial derivatives for g_access_p
37  \param[in] dvz vector to contain the z partial derivatives for g_access_p
38  \param[in] scalefactor scale factor to apply to the value of the cross
39  correlation term
40  \param[in] lderiv if true, the derivatives of the term are computed
41  \return the value of the cross correlation term: scalefac*(1-ccc)
42  */
43  /*
44  static float evaluate(DensityMap &f, SampledDensityMap &g,
45  const Particles &g_ps,
46  std::vector<float> &dvx, std::vector<float>&dvy,
47  std::vector<float>&dvz, float scalefac, bool lderiv);
48  */
49  /*
50  static void calc_derivatives(const DensityMap &comp1,
51  SampledDensityMap &comp2,
52  const Particles &ps_comp2,
53  const float &scalefac,
54  std::vector<float> &dvx, std::vector<float>&dvy,
55  std::vector<float>&dvz);
56 */
57 #endif
58 
59  /** Cross correlation coefficient between the em density and the density of a
60  model. moddens threshold can be specified that is checked in moddens to
61  reduce elements of summation
62  \note This is not the local CC function
63  \param[in] em_map the target map (experimentally determined)
64  \param[in] model_map the sampled density map of the model
65  \param[in] voxel_data_threshold voxels with value lower than threshold
66  in model_map are not summed (avoid calculating correlation on
67  voxels below the threshold)
68  \param[in] recalc_ccnormfac Ignored. The purpose is to determines whether
69  the model_map should be
70  normalized prior to the correlation calculation. false is
71  faster, but potentially inaccurate
72  \return the convolution value between two density maps
73 
74  \note recalc_ccnormfac is ignored.
75  */
76  static float convolution(const DensityMap *em_map, DensityMap *model_map,
77  float voxel_data_threshold,
78  bool recalc_ccnormfac = true);
79 };
80 
81 IMPEM_END_NAMESPACE
82 
83 #endif /* IMPEM_COARSE_CONVOLUTION_H */
Definitions for EMBED.
An approximation of the exponential function.
Class for handling density maps.
Class for handling density maps.
Definition: DensityMap.h:95
Sampled density map.
Convolutes two grids.