![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Driver for the alignment of one Shape::GaussianShapeFunction (the aligned shape) against a fixed reference Shape::GaussianShapeFunction. More...
#include <GaussianShapeFunctionAlignment.hpp>
Classes | |
| class | Result |
| A single alignment result: rigid-body transformation plus shape and color overlap values. More... | |
Public Types | |
| typedef std::shared_ptr< GaussianShapeFunctionAlignment > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeFunctionAlignment instances. More... | |
| typedef ResultList::const_iterator | ConstResultIterator |
| A constant iterator over the alignment results. More... | |
| typedef GaussianShapeOverlapFunction::ColorFilterFunction | ColorFilterFunction |
| Type of the function used to filter color (pharmacophore) features by type. More... | |
| typedef GaussianShapeOverlapFunction::ColorMatchFunction | ColorMatchFunction |
| Type of the function used to decide whether two color features match. More... | |
Public Member Functions | |
| GaussianShapeFunctionAlignment () | |
Constructs the GaussianShapeFunctionAlignment instance without a reference shape. More... | |
| GaussianShapeFunctionAlignment (const GaussianShapeFunction &ref_func, unsigned int sym_class) | |
Constructs the GaussianShapeFunctionAlignment instance with the given reference shape function. More... | |
| GaussianShapeFunctionAlignment (const GaussianShapeFunctionAlignment &alignment)=delete | |
| ~GaussianShapeFunctionAlignment () | |
| Destructor. More... | |
| GaussianShapeFunctionAlignment & | operator= (const GaussianShapeFunctionAlignment &alignment)=delete |
| void | setOverlapFunction (GaussianShapeOverlapFunction &func) |
| Specifies the Gaussian-shape overlap function used during alignment. More... | |
| GaussianShapeOverlapFunction & | getOverlapFunction () const |
| Returns the currently configured overlap function. More... | |
| const FastGaussianShapeOverlapFunction & | getDefaultOverlapFunction () const |
| Returns the built-in default overlap function (Shape::FastGaussianShapeOverlapFunction). More... | |
| FastGaussianShapeOverlapFunction & | getDefaultOverlapFunction () |
| Returns the built-in default overlap function (Shape::FastGaussianShapeOverlapFunction). More... | |
| void | setStartGenerator (GaussianShapeAlignmentStartGenerator &gen) |
| Specifies the alignment-start generator used to seed the overlap optimization. More... | |
| GaussianShapeAlignmentStartGenerator & | getStartGenerator () const |
| Returns the currently configured alignment-start generator. More... | |
| const PrincipalAxesAlignmentStartGenerator & | getDefaultStartGenerator () const |
| Returns the built-in default principal-axes alignment-start generator. More... | |
| PrincipalAxesAlignmentStartGenerator & | getDefaultStartGenerator () |
| Returns the built-in default principal-axes alignment-start generator. More... | |
| void | setColorMatchFunction (const ColorMatchFunction &func) |
| Specifies the function used to decide whether two color features match. More... | |
| const ColorMatchFunction & | getColorMatchFunction () const |
| Returns the currently configured color-match function. More... | |
| void | setColorFilterFunction (const ColorFilterFunction &func) |
| Specifies the function used to filter color features by type. More... | |
| const ColorFilterFunction & | getColorFilterFunction () const |
| Returns the currently configured color-filter function. More... | |
| void | performAlignment (bool perf_align) |
| Specifies whether the actual alignment shall be performed (vs. only evaluating overlaps in the initial pose). More... | |
| bool | performAlignment () const |
| Tells whether the actual alignment is performed. More... | |
| void | optimizeOverlap (bool optimize) |
| Specifies whether the overlap shall be optimized iteratively after the initial alignment. More... | |
| bool | optimizeOverlap () const |
| Tells whether the overlap is optimized iteratively. More... | |
| void | greedyOptimization (bool greedy) |
| Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum. More... | |
| bool | greedyOptimization () const |
| Tells whether the overlap optimization uses a greedy strategy. More... | |
| void | setMaxNumOptimizationIterations (std::size_t max_iter) |
| Sets the maximum number of overlap-optimization iterations. More... | |
| std::size_t | getMaxNumOptimizationIterations () const |
| Returns the currently configured maximum number of overlap-optimization iterations. More... | |
| void | setOptimizationStopGradient (double grad_norm) |
| Sets the gradient norm at which the overlap optimization is stopped. More... | |
| double | getOptimizationStopGradient () const |
| Returns the currently configured overlap-optimization stop gradient. More... | |
| unsigned int | setupReference (GaussianShapeFunction &func, Math::Matrix4D &xform) const |
| Delegates the reference-shape preparation to the configured start generator. More... | |
| unsigned int | setupAligned (GaussianShapeFunction &func, Math::Matrix4D &xform) const |
| Delegates the aligned-shape preparation to the configured start generator. More... | |
| void | setReference (const GaussianShapeFunction &func, unsigned int sym_class) |
| Sets the reference shape function used by subsequent align() calls. More... | |
| const GaussianShapeFunction * | getReference () const |
Returns the current reference shape function (or nullptr if none is set). More... | |
| double | calcSelfOverlap (const GaussianShapeFunction &func) |
| Calculates the shape-only self-overlap of func using the configured overlap function. More... | |
| double | calcColorSelfOverlap (const GaussianShapeFunction &func) |
| Calculates the color self-overlap of func using the configured overlap function. More... | |
| void | calcColorOverlaps (bool calc) |
| Specifies whether color overlaps shall be evaluated in addition to shape overlaps. More... | |
| bool | calcColorOverlaps () const |
| Tells whether color overlaps are evaluated. More... | |
| bool | align (const GaussianShapeFunction &func, unsigned int sym_class) |
| Aligns the shape function func against the configured reference shape. More... | |
| std::size_t | getNumResults () const |
| Returns the number of alignment results produced by the last align() call. More... | |
| const Result & | getResult (std::size_t idx) const |
| Returns the alignment result at index idx. More... | |
| ConstResultIterator | getResultsBegin () const |
| Returns a constant iterator pointing to the first alignment result. More... | |
| ConstResultIterator | getResultsEnd () const |
| Returns a constant iterator pointing one past the last alignment result. More... | |
| ConstResultIterator | begin () const |
| Returns a constant iterator pointing to the first alignment result (range-based for support). More... | |
| ConstResultIterator | end () const |
| Returns a constant iterator pointing one past the last alignment result (range-based for support). More... | |
Static Public Attributes | |
| static constexpr double | DEF_OPTIMIZATION_STOP_GRADIENT = 1.0 |
| Default gradient norm at which the overlap optimization is stopped. More... | |
| static constexpr std::size_t | DEF_MAX_OPTIMIZATION_ITERATIONS = 20 |
| Default maximum number of overlap-optimization iterations. More... | |
Driver for the alignment of one Shape::GaussianShapeFunction (the aligned shape) against a fixed reference Shape::GaussianShapeFunction.
The alignment iterates over starting transformations produced by a configurable Shape::GaussianShapeAlignmentStartGenerator, optionally refines each start via BFGS minimization (Math::BFGSMinimizer) of the overlap function, and collects the resulting transformations and overlap values in Result instances.
| typedef std::shared_ptr<GaussianShapeFunctionAlignment> CDPL::Shape::GaussianShapeFunctionAlignment::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeFunctionAlignment instances.
| typedef ResultList::const_iterator CDPL::Shape::GaussianShapeFunctionAlignment::ConstResultIterator |
A constant iterator over the alignment results.
| typedef GaussianShapeOverlapFunction::ColorFilterFunction CDPL::Shape::GaussianShapeFunctionAlignment::ColorFilterFunction |
Type of the function used to filter color (pharmacophore) features by type.
| typedef GaussianShapeOverlapFunction::ColorMatchFunction CDPL::Shape::GaussianShapeFunctionAlignment::ColorMatchFunction |
Type of the function used to decide whether two color features match.
| CDPL::Shape::GaussianShapeFunctionAlignment::GaussianShapeFunctionAlignment | ( | ) |
Constructs the GaussianShapeFunctionAlignment instance without a reference shape.
| CDPL::Shape::GaussianShapeFunctionAlignment::GaussianShapeFunctionAlignment | ( | const GaussianShapeFunction & | ref_func, |
| unsigned int | sym_class | ||
| ) |
Constructs the GaussianShapeFunctionAlignment instance with the given reference shape function.
| ref_func | The reference shape function. |
| sym_class | The symmetry class of the reference shape (see namespace Shape::SymmetryClass). |
|
delete |
| CDPL::Shape::GaussianShapeFunctionAlignment::~GaussianShapeFunctionAlignment | ( | ) |
Destructor.
|
delete |
| void CDPL::Shape::GaussianShapeFunctionAlignment::setOverlapFunction | ( | GaussianShapeOverlapFunction & | func | ) |
Specifies the Gaussian-shape overlap function used during alignment.
| func | The overlap function. |
| GaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeFunctionAlignment::getOverlapFunction | ( | ) | const |
Returns the currently configured overlap function.
| const FastGaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeFunctionAlignment::getDefaultOverlapFunction | ( | ) | const |
Returns the built-in default overlap function (Shape::FastGaussianShapeOverlapFunction).
const reference to the default overlap function. | FastGaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeFunctionAlignment::getDefaultOverlapFunction | ( | ) |
Returns the built-in default overlap function (Shape::FastGaussianShapeOverlapFunction).
| void CDPL::Shape::GaussianShapeFunctionAlignment::setStartGenerator | ( | GaussianShapeAlignmentStartGenerator & | gen | ) |
Specifies the alignment-start generator used to seed the overlap optimization.
| gen | The alignment-start generator. |
| GaussianShapeAlignmentStartGenerator& CDPL::Shape::GaussianShapeFunctionAlignment::getStartGenerator | ( | ) | const |
Returns the currently configured alignment-start generator.
| const PrincipalAxesAlignmentStartGenerator& CDPL::Shape::GaussianShapeFunctionAlignment::getDefaultStartGenerator | ( | ) | const |
Returns the built-in default principal-axes alignment-start generator.
const reference to the default alignment-start generator. | PrincipalAxesAlignmentStartGenerator& CDPL::Shape::GaussianShapeFunctionAlignment::getDefaultStartGenerator | ( | ) |
Returns the built-in default principal-axes alignment-start generator.
| void CDPL::Shape::GaussianShapeFunctionAlignment::setColorMatchFunction | ( | const ColorMatchFunction & | func | ) |
Specifies the function used to decide whether two color features match.
| func | The color-match function. |
| const ColorMatchFunction& CDPL::Shape::GaussianShapeFunctionAlignment::getColorMatchFunction | ( | ) | const |
Returns the currently configured color-match function.
const reference to the color-match function. | void CDPL::Shape::GaussianShapeFunctionAlignment::setColorFilterFunction | ( | const ColorFilterFunction & | func | ) |
Specifies the function used to filter color features by type.
| func | The color-filter function. |
| const ColorFilterFunction& CDPL::Shape::GaussianShapeFunctionAlignment::getColorFilterFunction | ( | ) | const |
Returns the currently configured color-filter function.
const reference to the color-filter function. | void CDPL::Shape::GaussianShapeFunctionAlignment::performAlignment | ( | bool | perf_align | ) |
Specifies whether the actual alignment shall be performed (vs. only evaluating overlaps in the initial pose).
| perf_align | true to perform the alignment, and false to only evaluate the initial pose. |
| bool CDPL::Shape::GaussianShapeFunctionAlignment::performAlignment | ( | ) | const |
Tells whether the actual alignment is performed.
true if the alignment is performed, and false otherwise. | void CDPL::Shape::GaussianShapeFunctionAlignment::optimizeOverlap | ( | bool | optimize | ) |
Specifies whether the overlap shall be optimized iteratively after the initial alignment.
| optimize | true to optimize the overlap, and false to skip optimization. |
| bool CDPL::Shape::GaussianShapeFunctionAlignment::optimizeOverlap | ( | ) | const |
Tells whether the overlap is optimized iteratively.
true if the overlap is optimized, and false otherwise. | void CDPL::Shape::GaussianShapeFunctionAlignment::greedyOptimization | ( | bool | greedy | ) |
Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum.
| greedy | true to use the greedy strategy, and false to use the full optimization. |
| bool CDPL::Shape::GaussianShapeFunctionAlignment::greedyOptimization | ( | ) | const |
Tells whether the overlap optimization uses a greedy strategy.
true if the greedy strategy is used, and false otherwise. | void CDPL::Shape::GaussianShapeFunctionAlignment::setMaxNumOptimizationIterations | ( | std::size_t | max_iter | ) |
Sets the maximum number of overlap-optimization iterations.
| max_iter | The new maximum number of iterations. |
| std::size_t CDPL::Shape::GaussianShapeFunctionAlignment::getMaxNumOptimizationIterations | ( | ) | const |
Returns the currently configured maximum number of overlap-optimization iterations.
| void CDPL::Shape::GaussianShapeFunctionAlignment::setOptimizationStopGradient | ( | double | grad_norm | ) |
Sets the gradient norm at which the overlap optimization is stopped.
| grad_norm | The new stop gradient norm. |
| double CDPL::Shape::GaussianShapeFunctionAlignment::getOptimizationStopGradient | ( | ) | const |
Returns the currently configured overlap-optimization stop gradient.
| unsigned int CDPL::Shape::GaussianShapeFunctionAlignment::setupReference | ( | GaussianShapeFunction & | func, |
| Math::Matrix4D & | xform | ||
| ) | const |
Delegates the reference-shape preparation to the configured start generator.
| func | The reference shape function (may be modified). |
| xform | The output transformation that maps the prepared frame back to the original frame. |
| unsigned int CDPL::Shape::GaussianShapeFunctionAlignment::setupAligned | ( | GaussianShapeFunction & | func, |
| Math::Matrix4D & | xform | ||
| ) | const |
Delegates the aligned-shape preparation to the configured start generator.
| func | The aligned shape function (may be modified). |
| xform | The output transformation that maps the prepared frame back to the original frame. |
| void CDPL::Shape::GaussianShapeFunctionAlignment::setReference | ( | const GaussianShapeFunction & | func, |
| unsigned int | sym_class | ||
| ) |
Sets the reference shape function used by subsequent align() calls.
| func | The reference shape function. |
| sym_class | The symmetry class of the reference shape (see namespace Shape::SymmetryClass). |
| const GaussianShapeFunction* CDPL::Shape::GaussianShapeFunctionAlignment::getReference | ( | ) | const |
Returns the current reference shape function (or nullptr if none is set).
| double CDPL::Shape::GaussianShapeFunctionAlignment::calcSelfOverlap | ( | const GaussianShapeFunction & | func | ) |
Calculates the shape-only self-overlap of func using the configured overlap function.
| func | The shape function. |
| double CDPL::Shape::GaussianShapeFunctionAlignment::calcColorSelfOverlap | ( | const GaussianShapeFunction & | func | ) |
Calculates the color self-overlap of func using the configured overlap function.
| func | The shape function. |
| void CDPL::Shape::GaussianShapeFunctionAlignment::calcColorOverlaps | ( | bool | calc | ) |
Specifies whether color overlaps shall be evaluated in addition to shape overlaps.
| calc | true to evaluate color overlaps, and false to skip them. |
| bool CDPL::Shape::GaussianShapeFunctionAlignment::calcColorOverlaps | ( | ) | const |
Tells whether color overlaps are evaluated.
true if color overlaps are evaluated, and false otherwise. | bool CDPL::Shape::GaussianShapeFunctionAlignment::align | ( | const GaussianShapeFunction & | func, |
| unsigned int | sym_class | ||
| ) |
Aligns the shape function func against the configured reference shape.
| func | The aligned shape function. |
| sym_class | The symmetry class of the aligned shape (see namespace Shape::SymmetryClass). |
true if at least one alignment result was produced, and false otherwise. | std::size_t CDPL::Shape::GaussianShapeFunctionAlignment::getNumResults | ( | ) | const |
Returns the number of alignment results produced by the last align() call.
| const Result& CDPL::Shape::GaussianShapeFunctionAlignment::getResult | ( | std::size_t | idx | ) | const |
Returns the alignment result at index idx.
| idx | The zero-based result index. |
const reference to the result. | Base::IndexError | if the number of results is zero or idx is not in the range [0, getNumResults() - 1]. |
| ConstResultIterator CDPL::Shape::GaussianShapeFunctionAlignment::getResultsBegin | ( | ) | const |
Returns a constant iterator pointing to the first alignment result.
| ConstResultIterator CDPL::Shape::GaussianShapeFunctionAlignment::getResultsEnd | ( | ) | const |
Returns a constant iterator pointing one past the last alignment result.
| ConstResultIterator CDPL::Shape::GaussianShapeFunctionAlignment::begin | ( | ) | const |
Returns a constant iterator pointing to the first alignment result (range-based for support).
| ConstResultIterator CDPL::Shape::GaussianShapeFunctionAlignment::end | ( | ) | const |
Returns a constant iterator pointing one past the last alignment result (range-based for support).
|
staticconstexpr |
Default gradient norm at which the overlap optimization is stopped.
|
staticconstexpr |
Default maximum number of overlap-optimization iterations.