question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deactivate freehand tool breaks all other tools

See original GitHub issue

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.

Description

deactivate freehand tool will cause other tools stop working

Steps to Reproduce

  1. Deactivate all other tools

  2. Activate targeting tool

  3. rectangleRoi tool or other tools will not work

Expected behavior: Switching tools like usual, deactivating all other tools than activate targeting tool

Actual behavior: Other tools will not activate after deactivate freehand tool

Codepen With Reproduction of Issue:

deactivateAll = (element) => {
    cornerstoneTools.stackScroll.deactivate(element)
    cornerstoneTools.zoom.deactivate(element)
    cornerstoneTools.wwwc.deactivate(element)
    cornerstoneTools.rectangleRoi.deactivate(element)
    cornerstoneTools.freehand.deactivate(element)
}
toggleRect = (e) => {
    const element = document.getElementById('dicomImage')
    this.deactivateAll(element)
    cornerstoneTools.rectangleRoi.activate(element, 1)
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
caooolcommented, Jul 11, 2018

OMG, it worked. My bad that I didn’t read carefully. Thank you very much!

1reaction
JamesAPettscommented, Jul 11, 2018

Hmm, this is strange, this is working on master on examples/allImageTools, which does just this:

       function disableAllTools() {
           cornerstoneTools.wwwc.disable(element);
           cornerstoneTools.pan.activate(element, 2); // 2 is middle mouse button
           cornerstoneTools.zoom.activate(element, 4); // 4 is right mouse button
           cornerstoneTools.probe.deactivate(element, 1);
           cornerstoneTools.length.deactivate(element, 1);
           cornerstoneTools.ellipticalRoi.deactivate(element, 1);
           cornerstoneTools.rectangleRoi.deactivate(element, 1);
           cornerstoneTools.angle.deactivate(element, 1);
           cornerstoneTools.highlight.deactivate(element, 1);
           cornerstoneTools.freehand.deactivate(element, 1);
           cornerstoneTools.eraser.deactivate(element, 1);
       }

       document.getElementById('rectangleroi').addEventListener('click', function() {
           activate('rectangleroi')
           disableAllTools();
           cornerstoneTools.rectangleRoi.activate(element, 1);
       });

       document.getElementById('freehand').addEventListener('click', function() {
           activate('freehand')
           disableAllTools();
           cornerstoneTools.freehand.activate(element, 1);
       });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Freehand tools - InVision Support
Delete : Delete the image. Duplicate: Duplicate the image in the same freehand. Pencil tool. The pencil tool ( ) lets you draw...
Read more >
How to turn off selection after freehand drawing? - Inkscape
Then you need to go to "Select-tool" and click on the canvas to deselect. Then you need to go to "Select-tool" and click...
Read more >
How do I turn off the freehand tool for players? | Roll20
If you can get your players to install the Stylus browser extension, you could have them each hide the Drawing Tool button from...
Read more >
Turning off the auto join in free hand tool ?? - CorelDRAW X3
Is there a way to turn off the auto join with the free hand tool/ I am trying to sketch and need to...
Read more >
Exploring the toolbox - CorelDRAW Help
To hide or display tools in the toolbox, click the Quick customize button , and enable or disable the corresponding check boxes. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found