Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Shape.GaussianShapeOverlapFunction Class Reference

Abstract base class for functions evaluating the overlap between two Gaussian shape functions. More...

+ Inheritance diagram for CDPL.Shape.GaussianShapeOverlapFunction:

Public Member Functions

None __init__ ()
 Initializes the GaussianShapeOverlapFunction instance.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setShapeFunction (GaussianShapeFunction func, bool is_ref)
 Specifies the reference or aligned shape function used by the overlap evaluation. More...
 
GaussianShapeFunction getShapeFunction (bool ref)
 Returns the reference or aligned shape function. 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...
 
float calcSelfOverlap (bool ref)
 Calculates the shape-only self-overlap of the reference or aligned shape function. More...
 
float calcColorSelfOverlap (bool ref)
 Calculates the color self-overlap of the reference or aligned shape function. More...
 
float calcOverlap ()
 Calculates the shape-only overlap of the reference and aligned shape functions. More...
 
float calcOverlap (Math.Vector3DArray coords)
 Calculates the shape-only overlap with the aligned shape element positions taken from coords. More...
 
float calcColorOverlap ()
 Calculates the color overlap of the reference and aligned shape functions. More...
 
float calcColorOverlap (Math.Vector3DArray coords)
 Calculates the color overlap with the aligned shape element positions taken from coords. More...
 
float calcOverlapGradient (Math.Vector3DArray coords, Math.Vector3DArray grad)
 Calculates the shape overlap with the aligned shape element positions taken from coords and returns the gradient with respect to those positions. More...
 

Properties

 objectID = property(getObjectID)
 
 colorMatchFunction = property(getColorMatchFunction, setColorMatchFunction)
 
 colorFilterFunction = property(getColorFilterFunction, setColorFilterFunction)
 

Detailed Description

Abstract base class for functions evaluating the overlap between two Gaussian shape functions.

Concrete subclasses (e.g. Shape.ExactGaussianShapeOverlapFunction, Shape.FastGaussianShapeOverlapFunction) implement the overlap evaluation using different trade-offs of accuracy vs. speed.

Member Function Documentation

◆ getObjectID()

int CDPL.Shape.GaussianShapeOverlapFunction.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python GaussianShapeOverlapFunction 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 GaussianShapeOverlapFunction 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().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ setShapeFunction()

None CDPL.Shape.GaussianShapeOverlapFunction.setShapeFunction ( GaussianShapeFunction  func,
bool  is_ref 
)

Specifies the reference or aligned shape function used by the overlap evaluation.

Parameters
funcThe shape function.
is_refIf True, func is the reference shape function. Otherwise, the aligned shape function.

◆ getShapeFunction()

GaussianShapeFunction CDPL.Shape.GaussianShapeOverlapFunction.getShapeFunction ( bool  ref)

Returns the reference or aligned shape function.

Parameters
refIf True, the reference shape function is returned. Otherwise, the aligned shape function.
Returns
A reference to the requested shape function (or nullptr if none is associated).

◆ setColorMatchFunction()

None CDPL.Shape.GaussianShapeOverlapFunction.setColorMatchFunction ( Pharm.BoolSizeType2Functor  func)

Specifies the function used to decide whether two color features match.

Parameters
funcThe color-match function.

◆ getColorMatchFunction()

Pharm.BoolSizeType2Functor CDPL.Shape.GaussianShapeOverlapFunction.getColorMatchFunction ( )

Returns the currently configured color-match function.

Returns
A reference to the color-match function.

◆ setColorFilterFunction()

None CDPL.Shape.GaussianShapeOverlapFunction.setColorFilterFunction ( BoolSizeTypeFunctor  func)

Specifies the function used to filter color features by type.

Parameters
funcThe color-filter function.

◆ getColorFilterFunction()

BoolSizeTypeFunctor CDPL.Shape.GaussianShapeOverlapFunction.getColorFilterFunction ( )

Returns the currently configured color-filter function.

Returns
A reference to the color-filter function.

◆ calcSelfOverlap()

float CDPL.Shape.GaussianShapeOverlapFunction.calcSelfOverlap ( bool  ref)

Calculates the shape-only self-overlap of the reference or aligned shape function.

Parameters
refIf True, the reference self-overlap is returned. Otherwise, the aligned self-overlap.
Returns
The self-overlap value.

◆ calcColorSelfOverlap()

float CDPL.Shape.GaussianShapeOverlapFunction.calcColorSelfOverlap ( bool  ref)

Calculates the color self-overlap of the reference or aligned shape function.

Parameters
refIf True, the reference color self-overlap is returned. Otherwise, the aligned color self-overlap.
Returns
The color self-overlap value.

◆ calcOverlap() [1/2]

float CDPL.Shape.GaussianShapeOverlapFunction.calcOverlap ( )

Calculates the shape-only overlap of the reference and aligned shape functions.

Returns
The shape overlap value.

◆ calcOverlap() [2/2]

float CDPL.Shape.GaussianShapeOverlapFunction.calcOverlap ( Math.Vector3DArray  coords)

Calculates the shape-only overlap with the aligned shape element positions taken from coords.

Parameters
coordsThe element 3D positions of the aligned shape.
Returns
The shape overlap value.

◆ calcColorOverlap() [1/2]

float CDPL.Shape.GaussianShapeOverlapFunction.calcColorOverlap ( )

Calculates the color overlap of the reference and aligned shape functions.

Returns
The color overlap value.

◆ calcColorOverlap() [2/2]

float CDPL.Shape.GaussianShapeOverlapFunction.calcColorOverlap ( Math.Vector3DArray  coords)

Calculates the color overlap with the aligned shape element positions taken from coords.

Parameters
coordsThe element 3D positions of the aligned shape.
Returns
The color overlap value.

◆ calcOverlapGradient()

float CDPL.Shape.GaussianShapeOverlapFunction.calcOverlapGradient ( Math.Vector3DArray  coords,
Math.Vector3DArray  grad 
)

Calculates the shape overlap with the aligned shape element positions taken from coords and returns the gradient with respect to those positions.

Parameters
coordsThe element 3D positions of the aligned shape.
gradThe output element-wise gradient of the overlap.
Returns
The shape overlap value.