Skip to content

Commit

Permalink
Fill rtree via stream instead of via insertion (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandervaneekelen authored Oct 27, 2024
1 parent 264dada commit 41e501c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wholeslidedata/annotation/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ class AnnotationSelector:
def __init__(self, annotations: List[Annotation], sorters):
self._annotations = annotations
self._sorters = sorters
self._tree = index.Index()
for pos, annotation in enumerate(annotations):
self._tree.insert(pos, annotation.bounds)
self._tree = index.Index(
(pos, annotation.bounds, None)
for pos, annotation in enumerate(self._annotations)
)

def select_annotations(
self, center_x: int, center_y: int, width: int, height: int
Expand Down

0 comments on commit 41e501c

Please sign in to comment.