[WIP]adding mobile touch support this is a bit messier than it looks
adding hammerjs to dependencies Fixes #2
https://mybinder.org/v2/gh/chestrays/cornerstone_widget/hammerjs?urlpath=apps%2Fnotebooks%2Fdemo.ipynb
Codecov Report
Merging #3 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #3 +/- ##
=======================================
Coverage 97.05% 97.05%
=======================================
Files 3 3
Lines 34 34
=======================================
Hits 33 33
Misses 1 1
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d52b49c...74f6827. Read the comment docs.
The other issues are to then replace and complement current tools with manually selected ones. It probably makes more sense to have a cornerstone and cornerstone mobile widget? https://github.com/cornerstonejs/cornerstoneTools/blob/master/examples/alltouchtools/index.html
var configuration = {
testPointers: function(eventData) {
return (eventData.numPointers >= 3);
}
};
cornerstoneTools.panMultiTouch.setConfiguration(configuration);
cornerstone.loadImage(imageIds[0]).then(function(image) {
cornerstone.displayImage(element, image);
// Set the stack as tool state
cornerstoneTools.addStackStateManager(element, ['stack']);
cornerstoneTools.addToolState(element, 'stack', stack);
cornerstoneTools.touchInput.enable(element);
// Enable all tools we want to use with this element
cornerstoneTools.zoomTouchPinch.activate(element);
//cornerstoneTools.rotateTouch.activate(element);
cornerstoneTools.wwwcTouchDrag.activate(element);
cornerstoneTools.panMultiTouch.activate(element);
// helper function used by the tool button handlers to disable the active tool
// before making a new tool active
function disableAllTools() {
cornerstoneTools.panTouchDrag.deactivate(element);
cornerstoneTools.rotateTouchDrag.deactivate(element);
cornerstoneTools.rotateTouch.disable(element);
cornerstoneTools.ellipticalRoiTouch.deactivate(element);
cornerstoneTools.angleTouch.deactivate(element);
cornerstoneTools.rectangleRoiTouch.deactivate(element);
cornerstoneTools.lengthTouch.deactivate(element);
cornerstoneTools.probeTouch.deactivate(element);
cornerstoneTools.zoomTouchDrag.deactivate(element);
cornerstoneTools.wwwcTouchDrag.deactivate(element);
cornerstoneTools.stackScrollTouchDrag.deactivate(element);
}