ShapeSignature

class ShapeSignature(registration_points: List[RegistrationPoint], hypergraph_incidence_matrix: ndarray)

A ShapeSignature represents a sort of “fingerprint” for a Shape.

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

centroid

The centroid (average location) of this signature.

direct_attribute_frequency

kdtree

locations

An (n, 3) numpy array containing each of the n locations of this signature.

neighbors_map

spoke_attribute_frequency

total_spokes

registration_points

The registration points within the signature.

Methods

can_embed_in

Returns True if there is a sub-signature in other such that self.signature.can_embed_in(sub_signature) returns True (see can_embed_in()).

explore_against

filter

filter_to_attributes

filter_to_rp

find_matches_for_other

transform

can_embed_in(other: ShapeSignature) bool

Returns True if there is a sub-signature in other such that self.signature.can_embed_in(sub_signature) returns True (see can_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 the n locations of this signature.

property neighbors_map: List[Set[int]]
registration_points

The registration points within the signature.

property spoke_attribute_frequency: Dict[ElementAttributes, int]
property total_spokes: int