Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to delete all the measurement? #1154

Closed
Vishal568 opened this issue Nov 7, 2019 · 2 comments
Closed

How to delete all the measurement? #1154

Vishal568 opened this issue Nov 7, 2019 · 2 comments

Comments

@Vishal568
Copy link

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.

@dannyrb
Copy link
Member

dannyrb commented Nov 7, 2019

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

@stale
Copy link

stale bot commented Nov 28, 2019

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 stale bot added the Stale 🥖 label Nov 28, 2019
@dannyrb dannyrb closed this as completed Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants