cornerstoneTools
cornerstoneTools copied to clipboard
registerCallback of segmentation module always trigger a warning
Prerequisites
Using latest version of cornerstone tools, no related issues found.
Description
When calling cornerstoneTools.init()
, registerCallback is called for each module.
Segmentation module has a registerCallback that just calls setColorLUT(0)
. This leads to a warning message from _checkColorLUTLength()
:
The provided colorLUT only provides 0 labels, whereas segmentsPerLabelmap is set to 56536. Autogenerating the rest.
This happens because colorLUT param has an empty array as default, so there is no way to avoid the warning message.
The only workaround I found is to place this line just before calling cornerstoneTools.init()
:
cornerstoneTools.getModule("segmentation").configuration.segmentsPerLabelmap = 0
.
But it sounds a bit of a hack to me.
Steps to Reproduce the issue
Just call cornerstoneTools.init()