ShapeSignature
- class ShapeSignature(registration_points: List[RegistrationPoint], hypergraph_incidence_matrix: ndarray)
A
ShapeSignature
represents a sort of “fingerprint” for aShape
.Shape signatures speed up embedding and matching by providing a data structure for faster comparisons. If one shape is embedded in another, its signature can embed in the other’s (see
can_embed_in()
). If one shape’s signature can embed in another’s, it is plausible that that shape can embed in the other. This provides a faster way to filter possible embedding transformations.- Parameters:
registration_points – The registration points within the signature.
rp_connectivity – A dictionary mapping each registration points ID to the IDs of registration points it’s connected to by a line carrier.
Attributes
The centroid (average location) of this signature.
An
(n, 3)
numpy array containing each of then
locations of this signature.The registration points within the signature.
Methods
Returns
True
if there is a sub-signature inother
such thatself.signature.can_embed_in(sub_signature)
returnsTrue
(seecan_embed_in()
).- can_embed_in(other: ShapeSignature) bool
Returns
True
if there is a sub-signature inother
such thatself.signature.can_embed_in(sub_signature)
returnsTrue
(seecan_embed_in()
).
- explore_against(other: ShapeSignature) Iterator[Tuple[int, RegistrationPoint]]
- filter(predicate: Callable[[RegistrationPoint], Any]) ShapeSignature
- filter_to_attributes(spoke_attributes: Set[ElementAttributes], direct_attributes: Set[ElementAttributes]) ShapeSignature
- filter_to_rp(rp: RegistrationPoint)
- find_matches_for_other(other: ShapeSignature, other_idxs: List[int], *, pre_filter: Callable[[int, int, int], bool] | None = None, post_filter: Callable[[Tuple[int, ...]], bool] | None = None) Iterator[Tuple[int, ...]]
- transform(transformation: Transformation) ShapeSignature
- property centroid
The centroid (average location) of this signature.
- property direct_attribute_frequency: Dict[ElementAttributes, int]
- property kdtree: KDTree
- property locations: ndarray
An
(n, 3)
numpy array containing each of then
locations of this signature.
- registration_points
The registration points within the signature.
- property spoke_attribute_frequency: Dict[ElementAttributes, int]