-
Notifications
You must be signed in to change notification settings - Fork 456
ToolsDesignGoalsandStatus
Danny Brown edited this page Feb 5, 2019
·
3 revisions
This documentation is for a much older version of
cornerstone-tools
. While it may still loosely apply, more recent information can be found at https://tools.cornerstonejs.org
The tools are currently being designed - this page captures my notes on the design goals and issues
Design goals for tools:
- Tools will draw themselves using HTML5 Canvas calls
- Tools usually work in the Pixel Coordinate System and it should be easy for them to draw with canvas in that coordinate system.
- A cornerstone tools library should provide functionality to make it easier to write tools - but use of such functionality should not be required. For example:
- drawing "handles" which can adjust measurement tools
- drawing text so it doesn't overlap the measurement itself (maybe with a line connecting it to an anchor on the measurement)
- Text that stays the same size regardless of the viewport scale
- Support for dragging measurements
- It should be possible for multiple images to share the same tool context/data. For example, if two enabled elements shared tool context and showed the same imageId, a measurement tool performed on one enabled element would show up on the other enabled element.
- Tools should be able to specify whether or not they store data per image or per image stack. A measurement tool that is per image would not show up if the image was changed to another. A tool that is per stack would show up even if the underlying imageId was changed (as long as it is part of the same stack)
- It should be straightforward to save and restore tool state in different formats. It is anticipated that such mechanism will be used to read and write to standard formats such as DICOM GSPS, DICOM SR and AIM
Some issues with the current design:
- We should make the tools configurable to support a few different interaction paradigms
- Whether rolling the mouse wheel forward zooms you in or out
- Whether moving up zooms you in or zooms you out
- Mapping of horizontal/vertical movements to window width/window center
- Mouse wheel up to scroll/cine forward or back
- Tool Data Management not ideal for modules that deal with persistence.
Some issues with the current implementation:
- The tools are currently using jquery mainly for mouse event handling. We may want to capture the events ourself and drop jquery to minimize dependencies.
- Currently just have an enable and disable. Disable completely removes the tool - we should have another function to keep the drawn tools around but unhook the mouse button so new ones are not created. NOTE - the length measurement tool conforms to the API established for Tool States
- No support for touch devices. The same code logic should be sharable between mouse and touch based interactions