![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
High-level driver for the alignment of Gaussian shapes against a set of reference shapes. More...
Inheritance diagram for CDPL.Shape.GaussianShapeAlignment:Public Member Functions | |
| None | __init__ () |
Constructs the GaussianShapeAlignment instance. | |
| None | __init__ (GaussianShape ref_shape) |
Constructs the GaussianShapeAlignment instance with ref_shape as the single reference shape. More... | |
| None | __init__ (GaussianShapeSet ref_shapes) |
Constructs the GaussianShapeAlignment instance with the shapes in ref_shapes as the reference set. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| None | setOverlapFunction (GaussianShapeOverlapFunction func) |
| Specifies the Gaussian-shape overlap function used during alignment. More... | |
| GaussianShapeOverlapFunction | getOverlapFunction () |
| Returns the currently configured overlap function. More... | |
| FastGaussianShapeOverlapFunction | getDefaultOverlapFunction () |
| Returns the built-in default overlap function. More... | |
| None | setStartGenerator (GaussianShapeAlignmentStartGenerator gen) |
| Specifies the alignment-start generator used to seed the overlap optimization. More... | |
| GaussianShapeAlignmentStartGenerator | getStartGenerator () |
| Returns the currently configured alignment-start generator. More... | |
| PrincipalAxesAlignmentStartGenerator | getDefaultStartGenerator () |
| Returns the built-in principal-axes alignment-start generator. More... | |
| None | setColorMatchFunction (Pharm.BoolSizeType2Functor func) |
| Specifies the function used to decide whether two color features match. More... | |
| Pharm.BoolSizeType2Functor | getColorMatchFunction () |
| Returns the currently configured color-match function. More... | |
| None | setColorFilterFunction (BoolSizeTypeFunctor func) |
| Specifies the function used to filter color features by type. More... | |
| BoolSizeTypeFunctor | getColorFilterFunction () |
| Returns the currently configured color-filter function. More... | |
| None | setResultCompareFunction (BoolAlignmentResult2Functor func) |
| Specifies the function used to compare two alignment results for sorting and filtering. More... | |
| BoolAlignmentResult2Functor | getResultCompareFunction () |
| Returns the currently configured result-compare function. More... | |
| None | setScoringFunction (DoubleAlignmentResultFunctor func) |
| Specifies the function used to score an alignment result. More... | |
| DoubleAlignmentResultFunctor | getScoringFunction () |
| Returns the currently configured scoring function. More... | |
| None | setResultSelectionMode (int mode) |
| Sets the alignment-result selection mode (see namespace Shape.AlignmentResultSelectionMode). More... | |
| int | getResultSelectionMode () |
| Returns the currently configured alignment-result selection mode. More... | |
| None | setMaxNumOptimizationIterations (int max_iter) |
| Sets the maximum number of overlap-optimization iterations. More... | |
| int | getMaxNumOptimizationIterations () |
| Returns the currently configured maximum number of overlap-optimization iterations. More... | |
| None | setOptimizationStopGradient (float grad_norm) |
| Sets the gradient norm at which the overlap optimization is stopped. More... | |
| float | getOptimizationStopGradient () |
| Returns the currently configured overlap-optimization stop gradient. More... | |
| None | performAlignment (bool perf_align) |
| Specifies whether the actual alignment shall be performed (vs. More... | |
| bool | performAlignment () |
| Tells whether the actual alignment is performed. More... | |
| None | optimizeOverlap (bool optimize) |
| Specifies whether the overlap shall be optimized iteratively after the initial alignment. More... | |
| bool | optimizeOverlap () |
| Tells whether the overlap is optimized iteratively. More... | |
| None | greedyOptimization (bool greedy) |
| Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum. More... | |
| bool | greedyOptimization () |
| Tells whether the overlap optimization uses a greedy strategy. More... | |
| None | calcColorOverlaps (bool calc) |
| Specifies whether color overlaps shall be computed in addition to shape overlaps. More... | |
| bool | calcColorOverlaps () |
| Tells whether color overlaps are computed in addition to shape overlaps. More... | |
| None | calcSelfOverlaps (bool calc) |
| Specifies whether shape self-overlaps shall be computed for the involved shapes. More... | |
| bool | calcSelfOverlaps () |
| Tells whether shape self-overlaps are computed for the involved shapes. More... | |
| None | calcColorSelfOverlaps (bool calc) |
| Specifies whether color self-overlaps shall be computed for the involved shapes. More... | |
| bool | calcColorSelfOverlaps () |
| Tells whether color self-overlaps are computed for the involved shapes. More... | |
| None | setMaxOrder (int max_order) |
| Sets the maximum order of the Gaussian-product expansion used by the overlap function. More... | |
| int | getMaxOrder () |
| Returns the currently configured maximum order of the Gaussian-product expansion. More... | |
| None | setDistanceCutoff (float cutoff) |
| Sets the distance cutoff for pruning negligible overlap contributions. More... | |
| float | getDistanceCutoff () |
| Returns the currently configured distance cutoff. More... | |
| None | clearReferenceShapes () |
| Removes all reference shapes and reference shape sets. | |
| None | addReferenceShape (GaussianShape shape, bool new_set=True) |
| Adds shape to the reference shapes. More... | |
| None | addReferenceShapes (GaussianShapeSet shapes, bool new_set=True) |
| Adds the shapes in shapes to the reference shapes. More... | |
| int | getNumReferenceShapes () |
| Returns the total number of reference shapes. More... | |
| GaussianShape | getReferenceShape (int idx) |
| Returns the reference shape at index idx. More... | |
| bool | align (GaussianShape shape) |
| Aligns shape against all reference shapes. More... | |
| bool | align (GaussianShapeSet shapes) |
| Aligns each shape in shapes against all reference shapes. More... | |
| int | getNumResults () |
| Returns the number of stored alignment results. More... | |
| AlignmentResult | getResult (int idx) |
| Returns the alignment result at index idx. More... | |
| int | __len__ () |
| AlignmentResult | __getitem__ (int idx) |
Static Public Attributes | |
| float | DEF_OPTIMIZATION_STOP_GRADIENT = 1.0 |
| Default gradient norm at which the overlap optimization is stopped. | |
| int | DEF_MAX_OPTIMIZATION_ITERATIONS = 20 |
| Default maximum number of overlap-optimization iterations. | |
| int | DEF_MAX_PRODUCT_ORDER = 1 |
| Default maximum order of the Gaussian-product expansion. | |
| float | DEF_DISTANCE_CUTOFF = 0.0 |
| Default distance cutoff for pruning negligible overlap contributions. | |
| int | DEF_RESULT_SELECTION_MODE = 3 |
| Default alignment-result selection mode. | |
High-level driver for the alignment of Gaussian shapes against a set of reference shapes.
The class manages a list of reference Gaussian shapes (organised into reference sets), runs the underlying Shape.GaussianShapeFunctionAlignment for each (reference, aligned) pair, and collects the Shape.AlignmentResult instances filtered according to the configured selection mode and comparator/scoring functions.
| None CDPL.Shape.GaussianShapeAlignment.__init__ | ( | GaussianShape | ref_shape | ) |
Constructs the GaussianShapeAlignment instance with ref_shape as the single reference shape.
| ref_shape | The reference shape. |
| None CDPL.Shape.GaussianShapeAlignment.__init__ | ( | GaussianShapeSet | ref_shapes | ) |
Constructs the GaussianShapeAlignment instance with the shapes in ref_shapes as the reference set.
| ref_shapes | The reference shapes. |
| int CDPL.Shape.GaussianShapeAlignment.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python GaussianShapeAlignment instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two GaussianShapeAlignment instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().
| None CDPL.Shape.GaussianShapeAlignment.setOverlapFunction | ( | GaussianShapeOverlapFunction | func | ) |
Specifies the Gaussian-shape overlap function used during alignment.
| func | The overlap function. |
| GaussianShapeOverlapFunction CDPL.Shape.GaussianShapeAlignment.getOverlapFunction | ( | ) |
Returns the currently configured overlap function.
| FastGaussianShapeOverlapFunction CDPL.Shape.GaussianShapeAlignment.getDefaultOverlapFunction | ( | ) |
Returns the built-in default overlap function.
| None CDPL.Shape.GaussianShapeAlignment.setStartGenerator | ( | GaussianShapeAlignmentStartGenerator | gen | ) |
Specifies the alignment-start generator used to seed the overlap optimization.
| gen | The alignment-start generator. |
| GaussianShapeAlignmentStartGenerator CDPL.Shape.GaussianShapeAlignment.getStartGenerator | ( | ) |
Returns the currently configured alignment-start generator.
| PrincipalAxesAlignmentStartGenerator CDPL.Shape.GaussianShapeAlignment.getDefaultStartGenerator | ( | ) |
Returns the built-in principal-axes alignment-start generator.
| None CDPL.Shape.GaussianShapeAlignment.setColorMatchFunction | ( | Pharm.BoolSizeType2Functor | func | ) |
Specifies the function used to decide whether two color features match.
| func | The color-match function. |
| Pharm.BoolSizeType2Functor CDPL.Shape.GaussianShapeAlignment.getColorMatchFunction | ( | ) |
Returns the currently configured color-match function.
| None CDPL.Shape.GaussianShapeAlignment.setColorFilterFunction | ( | BoolSizeTypeFunctor | func | ) |
Specifies the function used to filter color features by type.
| func | The color-filter function. |
| BoolSizeTypeFunctor CDPL.Shape.GaussianShapeAlignment.getColorFilterFunction | ( | ) |
Returns the currently configured color-filter function.
| None CDPL.Shape.GaussianShapeAlignment.setResultCompareFunction | ( | BoolAlignmentResult2Functor | func | ) |
Specifies the function used to compare two alignment results for sorting and filtering.
| func | The result-compare function. |
| BoolAlignmentResult2Functor CDPL.Shape.GaussianShapeAlignment.getResultCompareFunction | ( | ) |
Returns the currently configured result-compare function.
| None CDPL.Shape.GaussianShapeAlignment.setScoringFunction | ( | DoubleAlignmentResultFunctor | func | ) |
Specifies the function used to score an alignment result.
| func | The scoring function. |
| DoubleAlignmentResultFunctor CDPL.Shape.GaussianShapeAlignment.getScoringFunction | ( | ) |
Returns the currently configured scoring function.
| None CDPL.Shape.GaussianShapeAlignment.setResultSelectionMode | ( | int | mode | ) |
Sets the alignment-result selection mode (see namespace Shape.AlignmentResultSelectionMode).
| mode | The new result-selection mode. |
| int CDPL.Shape.GaussianShapeAlignment.getResultSelectionMode | ( | ) |
Returns the currently configured alignment-result selection mode.
| None CDPL.Shape.GaussianShapeAlignment.setMaxNumOptimizationIterations | ( | int | max_iter | ) |
Sets the maximum number of overlap-optimization iterations.
| max_iter | The new maximum number of iterations. |
| int CDPL.Shape.GaussianShapeAlignment.getMaxNumOptimizationIterations | ( | ) |
Returns the currently configured maximum number of overlap-optimization iterations.
| None CDPL.Shape.GaussianShapeAlignment.setOptimizationStopGradient | ( | float | grad_norm | ) |
Sets the gradient norm at which the overlap optimization is stopped.
| grad_norm | The new stop gradient norm. |
| float CDPL.Shape.GaussianShapeAlignment.getOptimizationStopGradient | ( | ) |
Returns the currently configured overlap-optimization stop gradient.
| None CDPL.Shape.GaussianShapeAlignment.performAlignment | ( | bool | perf_align | ) |
Specifies whether the actual alignment shall be performed (vs.
only computing overlaps in the initial pose).
| perf_align | True to perform the alignment, and False to only evaluate the initial pose. |
| bool CDPL.Shape.GaussianShapeAlignment.performAlignment | ( | ) |
Tells whether the actual alignment is performed.
True if the alignment is performed, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.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.GaussianShapeAlignment.optimizeOverlap | ( | ) |
Tells whether the overlap is optimized iteratively.
True if the overlap is optimized, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.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.GaussianShapeAlignment.greedyOptimization | ( | ) |
Tells whether the overlap optimization uses a greedy strategy.
True if the greedy strategy is used, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.calcColorOverlaps | ( | bool | calc | ) |
Specifies whether color overlaps shall be computed in addition to shape overlaps.
| calc | True to compute color overlaps, and False to skip them. |
| bool CDPL.Shape.GaussianShapeAlignment.calcColorOverlaps | ( | ) |
Tells whether color overlaps are computed in addition to shape overlaps.
True if color overlaps are computed, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.calcSelfOverlaps | ( | bool | calc | ) |
Specifies whether shape self-overlaps shall be computed for the involved shapes.
| calc | True to compute shape self-overlaps, and False to skip them. |
| bool CDPL.Shape.GaussianShapeAlignment.calcSelfOverlaps | ( | ) |
Tells whether shape self-overlaps are computed for the involved shapes.
True if shape self-overlaps are computed, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.calcColorSelfOverlaps | ( | bool | calc | ) |
Specifies whether color self-overlaps shall be computed for the involved shapes.
| calc | True to compute color self-overlaps, and False to skip them. |
| bool CDPL.Shape.GaussianShapeAlignment.calcColorSelfOverlaps | ( | ) |
Tells whether color self-overlaps are computed for the involved shapes.
True if color self-overlaps are computed, and False otherwise. | None CDPL.Shape.GaussianShapeAlignment.setMaxOrder | ( | int | max_order | ) |
Sets the maximum order of the Gaussian-product expansion used by the overlap function.
| max_order | The new maximum product order. |
| int CDPL.Shape.GaussianShapeAlignment.getMaxOrder | ( | ) |
Returns the currently configured maximum order of the Gaussian-product expansion.
| None CDPL.Shape.GaussianShapeAlignment.setDistanceCutoff | ( | float | cutoff | ) |
Sets the distance cutoff for pruning negligible overlap contributions.
| cutoff | The new distance cutoff. |
| float CDPL.Shape.GaussianShapeAlignment.getDistanceCutoff | ( | ) |
Returns the currently configured distance cutoff.
| None CDPL.Shape.GaussianShapeAlignment.addReferenceShape | ( | GaussianShape | shape, |
| bool | new_set = True |
||
| ) |
Adds shape to the reference shapes.
| shape | The reference shape. |
| new_set | If True, shape is added to a new reference set. Otherwise, it is appended to the most recent reference set. |
| None CDPL.Shape.GaussianShapeAlignment.addReferenceShapes | ( | GaussianShapeSet | shapes, |
| bool | new_set = True |
||
| ) |
Adds the shapes in shapes to the reference shapes.
| shapes | The reference shapes. |
| new_set | If True, the shapes are added to a new reference set. Otherwise, they are appended to the most recent reference set. |
| int CDPL.Shape.GaussianShapeAlignment.getNumReferenceShapes | ( | ) |
Returns the total number of reference shapes.
| GaussianShape CDPL.Shape.GaussianShapeAlignment.getReferenceShape | ( | int | idx | ) |
Returns the reference shape at index idx.
| idx | The zero-based index of the reference shape. |
| Base.IndexError | if the number of reference shapes is zero or idx is not in the range [0, getNumReferenceShapes() - 1]. |
| bool CDPL.Shape.GaussianShapeAlignment.align | ( | GaussianShape | shape | ) |
Aligns shape against all reference shapes.
| shape | The shape to align. |
True if at least one alignment result was produced, and False otherwise. | bool CDPL.Shape.GaussianShapeAlignment.align | ( | GaussianShapeSet | shapes | ) |
Aligns each shape in shapes against all reference shapes.
| shapes | The shapes to align. |
True if at least one alignment result was produced, and False otherwise. | int CDPL.Shape.GaussianShapeAlignment.getNumResults | ( | ) |
Returns the number of stored alignment results.
| AlignmentResult CDPL.Shape.GaussianShapeAlignment.getResult | ( | int | idx | ) |
Returns the alignment result at index idx.
| idx | The zero-based result index. |
| Base.IndexError | if the number of results is zero or idx is not in the range [0, getNumResults() - 1]. |
| int CDPL.Shape.GaussianShapeAlignment.__len__ | ( | ) |
| AlignmentResult CDPL.Shape.GaussianShapeAlignment.__getitem__ | ( | int | idx | ) |
| idx |