cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

Freehand Scissor Tool error

Open ghanemja opened this issue 3 years ago • 1 comments

Prerequisites

  • Version: 5.1.3
  • Reporting to correct repo

Description

Trying to use the freehand scissors tool and getting error saying:

"Consumers must define stack in their application if using segmentations in cornerstoneTools"

Steps to Reproduce the issue

  1. When I copied code from cornerstone tools examples to set up the freehand scissors tool
  2. Then I get the error that "Consumers must define stack in their application if using segmentations in cornerstoneTools"

We expect the scissor tool to work over an image we uploaded but it errored instead.

Thank you for any help!

ghanemja avatar Mar 15 '21 20:03 ghanemja

Hi @ghanemja, if you want to use segmentation module, you have to add a stack manager that contains the list of the cornerstone imageIds and the current active image on which you are using the tool. This should work: let stack = { currentImageIdIndex: currentImageIndex, imageIds: imageIds }; cornerstoneTools.addStackStateManager(element, ["stack"]); cornerstoneTools.addToolState(element, "stack", stack);

Or maybe you could try to use Larvitar, it's an open source library we build on top of cornerstone and cornerstone tools. It comes with docs and ready-to-use examples!

ronzim avatar Jun 29 '21 15:06 ronzim