How to use the cornerstone-tools.mouseInput function in cornerstone-tools

To help you get started, weโ€™ve selected a few cornerstone-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GleasonBian / CornerstoneVueWADO / src / components / HelloWorld.vue View on Github external
// ไธบ canvasStack ๆ‰พๅˆฐ imageIds
      let allImageIds = [];
      this.exampleStudyImageIds.forEach(function(imageId) {
        let imageUrl = "wadouri:" + _self.baseUrl + imageId;
        allImageIds.push(imageUrl);
      });

      // Create canvasStack
      let canvasStack = {
        currentImageIdIndex: 0,
        imageIds: allImageIds
      };

      // Enable Inputs
      cornerstoneTools.mouseInput.enable(canvas);
      cornerstoneTools.mouseWheelInput.enable(canvas);
      cornerstoneTools.touchInput.enable(canvas);

      // Set the stack as tool state
      cornerstoneTools.addStackStateManager(canvas, ["stack"]);
      cornerstoneTools.addToolState(canvas, "stack", canvasStack);
      cornerstoneTools.stackScrollWheel.activate(canvas); // Mouse wheel
      cornerstoneTools.scrollIndicator.enable(canvas); // Position indicator

      // Mouse
      cornerstoneTools.wwwc.activate(canvas, 1); // left click
      cornerstoneTools.pan.activate(canvas, 2); // middle click
      cornerstoneTools.zoom.activate(canvas, 4); // right click

      // Touch / Gesture
      cornerstoneTools.wwwcTouchDrag.activate(canvas); // - Drag
github PulseTile / PulseTile-React-Core / src / components / pages / Images / ImagesDetail / ImagesDetail.js View on Github external
moveImg = /* istanbul ignore next */ () => {
    const { touchMode } = this.state;
    const cornerstoneElement = this.getImgBlock();
    if (touchMode) {
      this.setState({ touchMode: false });
      this.swiper.allowTouchMove = false;
      cornerstoneTools.mouseInput.enable(cornerstoneElement);
      cornerstoneTools.pan.activate(cornerstoneElement, 1);
      cornerstoneTools.wwwc.disable(cornerstoneElement)
    } else {
      this.setState({ touchMode: true });
      this.swiper.allowTouchMove = true;
      this.disableCornerstoneTools(cornerstoneElement)
    }
  };
github chestrays / cornerstone_widget / js / lib / cs_widget.js View on Github external
_setup_tools: function () {
        ctools.mouseInput.enable(this.viewer);
        ctools.mouseWheelInput.enable(this.viewer);
        ctools.wwwc.activate(this.viewer, 1); // Left Click
        ctools.pan.activate(this.viewer, 2); // Middle Click
        ctools.zoom.activate(this.viewer, 4); // Right Click
        ctools.zoomWheel.activate(this.viewer); // Mouse Wheel
    },
    _disable_all_tools: function (element) {
github PulseTile / PulseTile-React-Core / src / components / pages / Images / ImagesDetail / ImagesDetail.js View on Github external
disableCornerstoneTools = (cornerstoneElement) => {
    cornerstoneTools.mouseInput.disable(cornerstoneElement);
    cornerstoneTools.pan.disable(cornerstoneElement);
    cornerstoneTools.wwwc.disable(cornerstoneElement);
  };