Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix correlating annotation bounding boxes on adjacent items #1628

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bug Fixes

- Fix scaling small images in the multi source with bicubic smoothing ([#1627](../../pull/1627))
- Fix correlating annotation bounding boxes on adjacent items for plottable data ([#1628](../../pull/1628))

## 1.29.7

Expand Down
20 changes: 11 additions & 9 deletions girder_annotation/girder_large_image_annotation/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,14 @@ def datafileAnnotationElementSelector(self, key, cols):
def annotationElementSelector(record, data, row):
bbox = [col[1](record, data, row) for col in cols]
if key in self._datacolumns:
for row in self._datacolumns[key]:
if self._datacolumns[key][row] is not None:
for srow in self._datacolumns[key]:
if self._datacolumns[key][srow] is not None:
for bidx, bkey in enumerate(['bbox.x0', 'bbox.y0', 'bbox.x1', 'bbox.y1']):
val = self._datacolumns[bkey].get(row)
val = self._datacolumns[bkey].get(srow)
if val is None or abs(val - bbox[bidx]) > 2:
break
else:
return self._datacolumns[key][row]
return self._datacolumns[key][srow]
return None

return annotationElementSelector
Expand Down Expand Up @@ -1038,11 +1038,13 @@ def _getColumnsFromAnnotations(self, columns):
for iidx, annotList in enumerate(self.annotations or []):
iid = str(self.items[iidx]['_id'])
for anidx, annot in enumerate(annotList):
# If the first item's annotation didn't contribute any required
# data to the data set, skip subsequent items' annotations;
# they are likely to be discarded.
if iidx and not countsPerAnnotation.get(anidx, 0) and not self._fullScan:
continue
# This had been checking if the first item's annotation didn't
# contribute any required data to the data set, skip subsequent
# items' annotations; they are likely to be discarded. This
# is untrue ui datafiles or folder level data augments the
# element records
# if iidx and not countsPerAnnotation.get(anidx, 0) and not self._fullScan:
# continue
startcount = count
if annot is None:
continue
Expand Down