Skip to content

brush tool's passiveCallback throws when changing image if globalToolSyncEnabled is true #924

@mikehazell

Description

@mikehazell

Prerequisites

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

Description

Crashing Bug: using the Brush tool with globalToolSyncEnabled can cause the application to crash when a new element is enabled.

Steps to Reproduce

  1. initialize csTools with { globalToolSyncEnabled: true }
  2. enable an element and load an image
  3. set the brush tool mode to "active"
  4. set the brush tool mode to "passive"
  5. enable a second element.

Expected behavior: [What you expected to happen]

The 2nd element should be enabled

Actual behavior: [What actually happened]

The application crashes with the following error.

Uncaught Error: updateImage: image has not been loaded yet
    at Module.<anonymous> (cornerstone.js:7603)
    at BrushTool.passiveCallback (cornerstoneTools.js:24482)
    at setToolModeForElement (cornerstoneTools.js:11614)
    at cornerstoneTools.js:11694
    at Array.forEach (<anonymous>)
    at _resolveInputConflicts (cornerstoneTools.js:11684)
    at setToolActiveForElement (cornerstoneTools.js:11430)
    at cornerstoneTools.js:10756
    at Array.forEach (<anonymous>)
    at _repeatGlobalToolHistory (cornerstoneTools.js:10753)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions