Skip to content

Commit

Permalink
fix annotation selector when fix offset
Browse files Browse the repository at this point in the history
  • Loading branch information
martvanrijthoven committed Nov 13, 2023
1 parent fdfd182 commit 0a20034
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wholeslidedata/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from wholeslidedata.annotation import utils as annotation_utils
from wholeslidedata.annotation.callbacks import OffsetAnnotationCallback
from wholeslidedata.annotation.selector import AnnotationSelector
from wholeslidedata.data.files import WholeSlideAnnotationFile, WholeSlideImageFile
from wholeslidedata.annotation.labels import Labels
from wholeslidedata.image.utils import get_offset
Expand Down Expand Up @@ -250,5 +251,6 @@ def fix_annotation_offsets(dataset):
wsa = list(values[WholeSlideDataSet.ANNOTATIONS_KEY].values())[0]
wsi = list(values[WholeSlideDataSet.IMAGES_KEY].values())[0]
x_offset, y_offset = get_offset(wsi)
annotation_callback = OffsetAnnotationCallback(x_offset, y_offset )
annotation_callback(wsa.annotations)
annotation_callback = OffsetAnnotationCallback(x_offset, y_offset)
annotation_callback(wsa.annotations)
wsa._annotation_selector = AnnotationSelector(wsa.annotations, sorters=wsa._parser.sorters)

0 comments on commit 0a20034

Please sign in to comment.