Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

FreehandRoi Tool ROI Cannot Be Removed

Open mtm12 opened this issue 6 years ago • 3 comments

I added the FreehandRoi tool to the toolbar and the tool draws an ROI but produces the following warnings:

MeasurementService.js?f3c7:274 Failed to map 'CornerstoneTools@4' measurement for definition RectangleRoi: Cannot read property 'toMeasurementSchema' of undefined

More importantly, there appears no way to remove the ROI drawn. Should the ROI appear as a measurement in the "Measurements" window where it could be deleted?

mtm12 avatar Mar 03 '20 17:03 mtm12

Today, the "MeasurementPanel" extension listens for cornerstone-tools measurement events. Those events inform the panel, and the panel tracks and displays the measurements.

src/appExtensions/MeasurementsPanel/*

I would check out ConnectedMeasurementTable.js and init.js to see why freeHandROI measurements aren't included in the table. It's possible the tool may not emit the data/events we expect, or that we have an "allow list" hardcoded somewhere.


In the future, the MeasurementsPanel will likely pull from the "Measurement Service". So that anything that pushes to the Measurement Service will update subscribers, like the Measurement Panel. Allowing us to decouple from cornerstone-tools as the source of truth.

dannyrb avatar Mar 04 '20 13:03 dannyrb

The ROI drawn with the FreehandRoi tool can be removed with the eraser. That is sufficient for now. But there's some other issue(s) because other tools such as the ellipse and rectangle ROI produce warnings in the measurement pane and don't show the measurement data. I believe these worked correctly in the past.

mtm12 avatar Mar 05 '20 04:03 mtm12

Ellipse and Rectangle may not currently work, but they should be easier to add support for as we improve the measurement service and the kinds of measurements it works with. Adding support for new measurements should be as simple as:

  • Adding a new "mapping" type to the Measurement Service
  • Providing a map from/to the measurement type to the Measurement Service's format
  • Making sure the underlying source (cornerstone-tools) pushes updates from measurement-* events to the service

The bulk of this will be implemented round trip for length and bidirectional. You'll be able to follow the same pattern for other tools.

dannyrb avatar Mar 09 '20 17:03 dannyrb