00001 /** 00002 * \file CoarseConvolution.h 00003 * \brief Convolutes two grids 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 * 00007 */ 00008 00009 #ifndef IMPEM_COARSE_CONVOLUTION_H 00010 #define IMPEM_COARSE_CONVOLUTION_H 00011 00012 #include "em_config.h" 00013 #include "exp.h" 00014 #include "DensityMap.h" 00015 #include "SampledDensityMap.h" 00016 #include "def.h" 00017 #include <vector> 00018 00019 IMPEM_BEGIN_NAMESPACE 00020 00021 //! Convolutes two grids 00022 /** The pixels involved are derived from the positions of N particles. 00023 */ 00024 class IMPEMEXPORT CoarseConvolution 00025 { 00026 00027 public: 00028 #if 0 00029 //! Evaluates the convolution between two density grids 00030 /** 00031 f*g(n)=f(m)g(n-m); m runs between -inf to inf 00032 \param[in] f A densityMap. note: 00033 correct RMSD and mean MUST be in the header! 00034 \param[in] g a sampled density map of particles 00035 \param[in] g_ps particles data (location, radii, weight) 00036 \param[in] dvx vector to contain the xpartial derivatives for g_access_p 00037 \param[in] dvy vector to contain the y partial derivatives for g_access_p 00038 \param[in] dvz vector to contain the z partial derivatives for g_access_p 00039 \param[in] scalefactor scale factor to apply to the value of the cross 00040 correlation term 00041 \param[in] lderiv if true, the derivatives of the term are computed 00042 \return the value of the cross correlation term: scalefac*(1-ccc) 00043 */ 00044 /* 00045 static float evaluate(DensityMap &f, SampledDensityMap &g, 00046 const Particles &g_ps, 00047 std::vector<float> &dvx, std::vector<float>&dvy, 00048 std::vector<float>&dvz, float scalefac, bool lderiv); 00049 */ 00050 /* 00051 static void calc_derivatives(const DensityMap &comp1, 00052 SampledDensityMap &comp2, 00053 const Particles &ps_comp2, 00054 const float &scalefac, 00055 std::vector<float> &dvx, std::vector<float>&dvy, 00056 std::vector<float>&dvz); 00057 */ 00058 #endif 00059 00060 /** Cross correlation coefficient between the em density and the density of a 00061 model. moddens threshold can be specified that is checked in moddens to 00062 reduce elements of summation 00063 \note This is not the local CC function 00064 \param[in] em_map the target map (experimentally determined) 00065 \param[in] model_map the sampled density map of the model 00066 \param[in] voxel_data_threshold voxels with value lower than threshold 00067 in model_map are not summed (avoid calculating correlation on 00068 voxels below the threshold) 00069 \param[in] recalc_ccnormfac determines wheather the model_map should be 00070 normalized prior to the correlation calculation. false is 00071 faster, but potentially innacurate 00072 \return the convolution value between two density maps 00073 */ 00074 static float convolution(const DensityMap &em_map,DensityMap &model_map, 00075 float voxel_data_threshold, 00076 bool recalc_ccnormfac = true); 00077 }; 00078 00079 IMPEM_END_NAMESPACE 00080 00081 #endif /* IMPEM_COARSE_CONVOLUTION_H */