IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
EnvelopeScore.h
Go to the documentation of this file.
1/**
2 * \file IMP/em/EnvelopeScore.h
3 * \brief class for envelope based scoring using MapDistanceTransform
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 *
7 */
8
9#ifndef IMPEM_ENVELOPE_SCORE_H
10#define IMPEM_ENVELOPE_SCORE_H
11
12#include <IMP/em/em_config.h>
14#include <IMP/Object.h>
15
16#include <vector>
17
18IMPEM_BEGIN_NAMESPACE
19
20//! class for envelope based scoring using MapDistanceTransform
21class IMPEMEXPORT EnvelopeScore : public IMP::Object {
22 public:
23 // init with MapDistanceTransform
24 EnvelopeScore(const MapDistanceTransform* mdt);
25
26 /** check for penetration with respect to the envelope as defined
27 by the distance transform
28 \param[in] points check this set of points for penetration
29 \param[in] penetration_thr threshold that defines penetration.
30 Use penetration_thr=0 to require for all points inside the envelope
31 to allow some penetration set the threshold to the -distance of
32 the allowed penetration distance. Recommended value is map
33 resolution.
34 */
36 float penetration_thr) const;
37
38 /** same as above
39 \param[in] points
40 \param[in] trans apply this transformation on points before
41 checking for penetrations
42 \param[in] penetration_thr
43 */
46 float penetration_thr) const;
47
48 /**
49 score points with respect to the distance transform
50 the score awards points that fall into the envelope
51 and penalizes for points outside the envelope
52 */
53 double score(const IMP::algebra::Vector3Ds& points) const;
54
55 /** same as above
56 \param[in] points
57 \param[in] trans apply this transformation on points before scoring
58 */
59 double score(const IMP::algebra::Vector3Ds& points,
60 const IMP::algebra::Transformation3D& trans) const;
61
62 // methods required by Object
64 return IMP::VersionInfo(get_module_name(), get_module_version());
65 }
66
68
69 private:
70 unsigned int find_range(float distance) const {
71 for (unsigned int i = 0; i < ranges_.size(); i++)
72 // Add a small delta to handle floating point 'equals'
73 if (distance <= ranges_[i] + 1e-5) return i;
74 return ranges_.size();
75 }
76
77 private:
78 const MapDistanceTransform* mdt_;
79 std::vector<float> ranges_;
80 std::vector<int> weights_;
81 std::vector<long> inner_voxels_;
82 std::vector<long> neighbors_;
83};
84
85IMPEM_END_NAMESPACE
86
87#endif /* IMPEM_ENVELOPE_SCORE_H */
class for computing a distance transform of the density map
A shared base class to help in debugging and things.
Common base class for heavy weight IMP objects.
Definition Object.h:111
Version and module information for Objects.
Definition VersionInfo.h:29
Simple 3D transformation class.
class for envelope based scoring using MapDistanceTransform
double score(const IMP::algebra::Vector3Ds &points) const
IMP::VersionInfo get_version_info() const override
Get information about the module and version of the object.
double score(const IMP::algebra::Vector3Ds &points, const IMP::algebra::Transformation3D &trans) const
bool is_penetrating(const IMP::algebra::Vector3Ds &points, float penetration_thr) const
bool is_penetrating(const IMP::algebra::Vector3Ds &points, const IMP::algebra::Transformation3D &trans, float penetration_thr) const
Class for getting the distance from the map envelope.
Vector< VectorD< 3 > > Vector3Ds
Definition VectorD.h:409