Skip to content

Commit

Permalink
fix: select segments on uint64 arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Jul 5, 2023
1 parent f710fd4 commit 37419c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGES
=======

1.6.2
-----

* fix: brushes are circular on rectangular images
* fix: use pixelated image rendering in chrome

1.6.1
-----

Expand Down
11 changes: 7 additions & 4 deletions microviewer/datacube.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ class SegmentationVolume extends MonoVolume {
y0 = Math.max(0, Math.trunc(cy - ry) + 0.5),
yf = Math.min(width, Math.trunc(cy + ry) + 0.5);

let segid = 0,
const ZERO = _this.getSegmentation().cast(0);
let segid = ZERO,
bounds_test = 0.0;

let segids = {};
Expand All @@ -397,8 +398,10 @@ class SegmentationVolume extends MonoVolume {
for (var x = x0; x <= xf; x++) {
for (var y = y0; y <= yf; y++) {
bounds_test = ((x - cx) * (x - cx) / rx2) + ((y - cy) * (y - cy) / ry2);
segid = ((bounds_test < 1) && buffer[(x|0) + width * (y|0)]) | 0;
segids[segid] = true;
if (bounds_test < 1) {
segid = buffer[(x|0) + width * (y|0)] | ZERO;
segids[segid] = true;
}
}
}

Expand Down Expand Up @@ -452,7 +455,7 @@ class SegmentationVolume extends MonoVolume {
y0 = Math.max(0, Math.trunc(cy - ry) + 0.5),
yf = Math.min(height, Math.trunc(cy + ry) + 0.5);

let segid = 0,
let segid = _this.getSegmentation().cast(0),
bounds_test = 0.0;

// For anisotropic data, we need to distort our circle (UI) into an ellipse
Expand Down

0 comments on commit 37419c0

Please sign in to comment.