Skip to content

Commit

Permalink
perf(bulkAnnotations): cache affine (#159)
Browse files Browse the repository at this point in the history
* perf(bulkAnnotations): cache affine

* fix: typo

---------

Co-authored-by: Helmut (Oertel) Hoffer von Ankershoffen <[email protected]>
  • Loading branch information
helmut-hoffer-von-ankershoffen and Helmut (Oertel) Hoffer von Ankershoffen authored Nov 12, 2024
1 parent 628555a commit 2cf1e62
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/bulkAnnotations/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ export const getFeaturesFromBulkAnnotations = ({

const { topLeft, bottomRight } = getViewportBoundingBox({ view, pyramid, affine })

const cachedAffine = getAffineBasedOnPyramidLevel({
affine,
pyramid,
annotationGroup
})

const features = []

for (
Expand All @@ -492,11 +498,7 @@ export const getFeaturesFromBulkAnnotations = ({
if (annotationCoordinateType === '2D') {
firstCoordinate = mapPixelCoordToSlideCoord({
point: [firstCoordinate[0], firstCoordinate[1]],
affine: getAffineBasedOnPyramidLevel({
affine,
pyramid,
annotationGroup
})
affine: cachedAffine
})
}

Expand Down

0 comments on commit 2cf1e62

Please sign in to comment.