cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

Reversing the ellipse measurements and rendering it programatically.

Open kongkip opened this issue 2 years ago • 0 comments

  • Using the latest version.
  • I am writing about this issue to get help.
  • I searched the issue but couldn't find it.

Hello there, I have an API endpoint that returns the ellipse points, center x, center y, short distance, long-distance, and angle and I would want to render them with the ellipse tool on the viewport. However, Ellipse Tool requires the points start x, start y, end x,end y, and initial rotation. My question is, is it possible to reverse the points I am getting from the API to correspond to the later points for rendering with cornerstone? what formulae can I use?

In the file drawing\drawEllipse.js, the ellipse is drawn on the canvas passing the points same as the ones I get from the API.


  path(context, options, context => {
    context.ellipse(center.x, center.y, w / 2, h / 2, angle, 0, 2 * Math.PI);
    context.closePath();
  });

kongkip avatar Jun 21 '22 20:06 kongkip