Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

How to delete all the measurement?

Open Vishal568 opened this issue 7 years ago • 2 comments

Hello,

I want to delete all the measurements. And I try to this code but when I delete 400 measurements then the browser hangs and closes.

 toolids.forEach(data=>{
            var toolId = data;
            OHIF.viewer.measurementApi.deleteMeasurements(measurementTypeId, { toolId });
 });

anyone can help me how can I delete a large number of measurements.

Vishal568 avatar Nov 07 '19 04:11 Vishal568

Where are you triggering the delete from? @ohif/extension-cornerstone, @ohif/viewer, or the internal MeasurementsPanel Extension?

As of today, the best way to do this is to probably use the cornerstone-tools API to delete measurements; This raises an event that the MeasurementApi catches, and causes the data to be deleted on its end as well.

In the future, we want a "MeasurementsService" to be a source of truth that other extensions can register listeners for, or push to, to better sync/react to toolState changes

dannyrb avatar Nov 07 '19 15:11 dannyrb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 28 '19 15:11 stale[bot]