![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Driver for the alignment of one Shape.GaussianShapeFunction (the aligned shape) against a fixed reference Shape.GaussianShapeFunction. More...
Inheritance diagram for CDPL.Shape.GaussianShapeFunctionAlignment:Classes | |
| class | Result |
| A single alignment result: rigid-body transformation plus shape and color overlap values. More... | |
Public Member Functions | |
| None | __init__ () |
Constructs the GaussianShapeFunctionAlignment instance without a reference shape. | |
| None | __init__ (GaussianShapeFunction ref_func, int sym_class) |
Constructs the GaussianShapeFunctionAlignment instance with the given reference shape function. 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 (Shape.FastGaussianShapeOverlapFunction). More... | |
| None | setReference (GaussianShapeFunction func, int sym_class) |
| Sets the reference shape function used by subsequent align() calls. More... | |
| GaussianShapeFunction | getReference () |
Returns the current reference shape function (or nullptr if none is set). 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 default 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 | 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 | 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 | 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... | |
| int | setupReference (GaussianShapeFunction func, Math.Matrix4D xform) |
| Delegates the reference-shape preparation to the configured start generator. More... | |
| int | setupAligned (GaussianShapeFunction func, Math.Matrix4D xform) |
| Delegates the aligned-shape preparation to the configured start generator. More... | |
| float | calcSelfOverlap (GaussianShapeFunction func) |
| Calculates the shape-only self-overlap of func using the configured overlap function. More... | |
| float | calcColorSelfOverlap (GaussianShapeFunction func) |
| Calculates the color self-overlap of func using the configured overlap function. More... | |
| None | calcColorOverlaps (bool calc) |
| Specifies whether color overlaps shall be evaluated in addition to shape overlaps. More... | |
| bool | calcColorOverlaps () |
| Tells whether color overlaps are evaluated. More... | |
| bool | align (GaussianShapeFunction func, int sym_class) |
| Aligns the shape function func against the configured reference shape. More... | |
| int | getNumResults () |
| Returns the number of alignment results produced by the last align() call. More... | |
| Result | getResult (int idx) |
| Returns the alignment result at index idx. More... | |
| int | __len__ () |
| Result | __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. | |
Properties | |
| objectID = property(getObjectID) | |
| numResults = property(getNumResults) | |
| overlapFunction = property(getOverlapFunction, setOverlapFunction) | |
| defaultOverlapFunction = property(getDefaultOverlapFunction) | |
| reference = property(getReference, setReference) | |
| startGenerator = property(getStartGenerator, setStartGenerator) | |
| defaultStartGenerator = property(getDefaultStartGenerator) | |
| colorMatchFunction = property(getColorMatchFunction, setColorMatchFunction) | |
| colorFilterFunction = property(getColorFilterFunction, setColorFilterFunction) | |
| perfAlignment = property(performAlignment, performAlignment) | |
| maxNumOptIterations = property(getMaxNumOptimizationIterations, setMaxNumOptimizationIterations) | |
| optStopGradient = property(getOptimizationStopGradient, setOptimizationStopGradient) | |
| optOverlap = property(optimizeOverlap, optimizeOverlap) | |
| greedyOpt = property(greedyOptimization, greedyOptimization) | |
| colorOverlaps = property(calcColorOverlaps, calcColorOverlaps) | |
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.
| None CDPL.Shape.GaussianShapeFunctionAlignment.__init__ | ( | GaussianShapeFunction | ref_func, |
| 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). |
| int CDPL.Shape.GaussianShapeFunctionAlignment.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python GaussianShapeFunctionAlignment 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 GaussianShapeFunctionAlignment 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.GaussianShapeFunctionAlignment.setOverlapFunction | ( | GaussianShapeOverlapFunction | func | ) |
Specifies the Gaussian-shape overlap function used during alignment.
| func | The overlap function. |
| GaussianShapeOverlapFunction CDPL.Shape.GaussianShapeFunctionAlignment.getOverlapFunction | ( | ) |
Returns the currently configured overlap function.
| FastGaussianShapeOverlapFunction CDPL.Shape.GaussianShapeFunctionAlignment.getDefaultOverlapFunction | ( | ) |
Returns the built-in default overlap function (Shape.FastGaussianShapeOverlapFunction).
| None CDPL.Shape.GaussianShapeFunctionAlignment.setReference | ( | GaussianShapeFunction | func, |
| 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). |
| GaussianShapeFunction CDPL.Shape.GaussianShapeFunctionAlignment.getReference | ( | ) |
Returns the current reference shape function (or nullptr if none is set).
| None 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 | ( | ) |
Returns the currently configured alignment-start generator.
| PrincipalAxesAlignmentStartGenerator CDPL.Shape.GaussianShapeFunctionAlignment.getDefaultStartGenerator | ( | ) |
Returns the built-in default principal-axes alignment-start generator.
| None CDPL.Shape.GaussianShapeFunctionAlignment.setColorMatchFunction | ( | Pharm.BoolSizeType2Functor | func | ) |
Specifies the function used to decide whether two color features match.
| func | The color-match function. |
| Pharm.BoolSizeType2Functor CDPL.Shape.GaussianShapeFunctionAlignment.getColorMatchFunction | ( | ) |
Returns the currently configured color-match function.
| None CDPL.Shape.GaussianShapeFunctionAlignment.setColorFilterFunction | ( | BoolSizeTypeFunctor | func | ) |
Specifies the function used to filter color features by type.
| func | The color-filter function. |
| BoolSizeTypeFunctor CDPL.Shape.GaussianShapeFunctionAlignment.getColorFilterFunction | ( | ) |
Returns the currently configured color-filter function.
| None 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 | ( | ) |
Tells whether the actual alignment is performed.
True if the alignment is performed, and False otherwise. | None CDPL.Shape.GaussianShapeFunctionAlignment.setMaxNumOptimizationIterations | ( | int | max_iter | ) |
Sets the maximum number of overlap-optimization iterations.
| max_iter | The new maximum number of iterations. |
| int CDPL.Shape.GaussianShapeFunctionAlignment.getMaxNumOptimizationIterations | ( | ) |
Returns the currently configured maximum number of overlap-optimization iterations.
| None CDPL.Shape.GaussianShapeFunctionAlignment.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.GaussianShapeFunctionAlignment.getOptimizationStopGradient | ( | ) |
Returns the currently configured overlap-optimization stop gradient.
| None 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 | ( | ) |
Tells whether the overlap is optimized iteratively.
True if the overlap is optimized, and False otherwise. | None 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 | ( | ) |
Tells whether the overlap optimization uses a greedy strategy.
True if the greedy strategy is used, and False otherwise. | int CDPL.Shape.GaussianShapeFunctionAlignment.setupReference | ( | GaussianShapeFunction | func, |
| Math.Matrix4D | xform | ||
| ) |
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. |
| int CDPL.Shape.GaussianShapeFunctionAlignment.setupAligned | ( | GaussianShapeFunction | func, |
| Math.Matrix4D | xform | ||
| ) |
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. |
| float CDPL.Shape.GaussianShapeFunctionAlignment.calcSelfOverlap | ( | GaussianShapeFunction | func | ) |
Calculates the shape-only self-overlap of func using the configured overlap function.
| func | The shape function. |
| float CDPL.Shape.GaussianShapeFunctionAlignment.calcColorSelfOverlap | ( | GaussianShapeFunction | func | ) |
Calculates the color self-overlap of func using the configured overlap function.
| func | The shape function. |
| None 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 | ( | ) |
Tells whether color overlaps are evaluated.
True if color overlaps are evaluated, and False otherwise. | bool CDPL.Shape.GaussianShapeFunctionAlignment.align | ( | GaussianShapeFunction | func, |
| 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. | int CDPL.Shape.GaussianShapeFunctionAlignment.getNumResults | ( | ) |
Returns the number of alignment results produced by the last align() call.
| Result CDPL.Shape.GaussianShapeFunctionAlignment.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.GaussianShapeFunctionAlignment.__len__ | ( | ) |
| Result CDPL.Shape.GaussianShapeFunctionAlignment.__getitem__ | ( | int | idx | ) |
| idx |