Skip to content

Commit

Permalink
fixed the issue with segmentation in drawing point and ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
nanli-emory committed May 16, 2024
1 parent 1ce68cf commit f980722
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions core/extension/osd-segment-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
segment.provenance.analysis.coordinate &&
segment.provenance.analysis.coordinate == 'image'){
convertX = this._viewer.imagingHelper.dataToPhysicalX.bind(this._viewer.imagingHelper);
convertY = this._viewer.imagingHelper.dataToPhysicalY.bind(this._viewer.imagingHelper);
convertY = this._viewer.imagingHelper.dataToPhysicalY.bind(this._viewer.imagingHelper);
}
this._display_ctx_.lineJoin = style.lineJoin;
this._display_ctx_.lineCap = style.lineCap;
Expand All @@ -398,17 +398,22 @@
//
if(polygon.geometry.type == 'Point') {
this._display_ctx_.arc(
convertX(points[0]) + this._offset[0],
convertY(points[1]) + this._offset[1],
this._display_ctx_.radius * 2, 0, 2 * Math.PI
convertX(polygon.geometry.coordinates[0]) + this._offset[0],
convertY(polygon.geometry.coordinates[1]) + this._offset[1],
1
//this._display_ctx_.radius * 2
, 0, 2 * Math.PI
);

} else if (polygon.geometry.type == 'Ellipse') {
//

let convertDistance = this._viewer.imagingHelper.logicalToPhysicalDistance.bind(this._viewer.imagingHelper);
this._display_ctx_.ellipse(
convertX(points[0]) + this._offset[0],
convertY(points[1]) + this._offset[1],
convertX(radius[0]),
convertX(radius[1]),
convertX(polygon.geometry.coordinates[0]) + this._offset[0],
convertY(polygon.geometry.coordinates[1]) + this._offset[1],
convertDistance(polygon.geometry.radius[0]),
convertDistance(polygon.geometry.radius[1]),
polygon.geometry.rotation,
0,
2 * Math.PI
Expand Down

0 comments on commit f980722

Please sign in to comment.