Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Add Measurements Manually with out any event in React based OHIF Viewer

Open Vishal568 opened this issue 7 years ago • 3 comments

I want to add rectangleROI without any event(mouse/touch) please help me with the demo code.

I have seen that this depends on the mouse events which creates the measurement. But I have all the necessary information to draw the rectangle already. And I want to add the measurement manually.

I am a beginner in node/React.

Thanks a lot in advance.

Vishal568 avatar Sep 02 '19 06:09 Vishal568

Today, toolstate primarily lives in cornerstone-tools. In the future, I'm hoping we surface a library agnostic MeasurementService or manager. The easiest way is to hook into the get/setToolState methods for cornerstone-tools.

https://github.com/cornerstonejs/cornerstoneTools/blob/master/src/index.js#L144-L145

There may be a convenience method on our MeasurementAPI that adds it to our measurement table, but also syncs with cornerstone-tools, but I'm not familiar.

This is something we should look into, but I'm open to suggestions on how you would expect this to be implemented.

dannyrb avatar Sep 06 '19 17:09 dannyrb

Thanks @dannyrb

Your Guidance is very helpful.

Vishal568 avatar Sep 09 '19 04:09 Vishal568

@dannyrb you got it working?

Nits7029 avatar Oct 21 '19 09:10 Nits7029