How to use the cornerstone-tools.wwwc 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 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 Kitware / paraview-glance / Sources / externals / MedicalCornerstone / toolsConfig.js View on Github external
activateArgs: ['binding'],
      deactivateArgs: ['binding'],
    },
    zoom: {
      tool: cornerstoneTools.zoom,
      type: ToolTypes.Mouse,
      binding: MouseButtons.Right,
      icon: 'search-plus',
      activateArgs: ['binding'],
      deactivateArgs: ['binding'],
    },
    wwwc: {
      // When using a bundled cornerstone tool, be sure to name
      // the tool as the same name as the cornerstone tool to ensure
      // tool state is synchronized.
      tool: cornerstoneTools.wwwc,
      type: ToolTypes.Mouse,
      // What binding argument for the type of tool.
      binding: MouseButtons.Left,
      // This is a FontAwesome icon name
      icon: 'adjust',
      // Specifies the ordering of arguments. Arguments are provided via
      // an "args" object below.
      // The special name "binding" will take the value of the
      // "binding" property above.
      activateArgs: ['binding'],
      deactivateArgs: ['binding'],
      args: {},

      // tool properties (sets properties on tool object)
      props: {
        strategy: Tools.wwwc.glanceStrategy,
github GleasonBian / CornerstoneVueWADO / src / components / HelloWorld.vue View on Github external
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
      cornerstoneTools.zoomTouchPinch.activate(canvas); // - Pinch
      cornerstoneTools.panMultiTouch.activate(canvas); // - Multi (x2)
    },
    /*
github chestrays / cornerstone_widget / js / lib / cs_widget.js View on Github external
_disable_all_tools: function (element) {
        // helper function used by the tool button handlers to disable the active tool
        // before making a new tool active
        ctools.wwwc.deactivate(element, 1);
        ctools.pan.deactivate(element, 2); // 2 is middle mouse button
        ctools.zoom.deactivate(element, 4); // 4 is right mouse button
        ctools.length.deactivate(element, 1);
        ctools.ellipticalRoi.deactivate(element, 1);
        ctools.rectangleRoi.deactivate(element, 1);
        ctools.angle.deactivate(element, 1);
        ctools.highlight.deactivate(element, 1);
        ctools.freehand.deactivate(element, 1);
        ctools.probe.deactivate(element, 1);

    },
    activate_tool: function () {
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);
  };