1

我想在我的 DICOM 查看器中添加一个选项来更改由手绘工具制作的多边形的颜色(每个多边形的颜色不同)。

我检查了官方示例,似乎cornerstoneTools 允许您的唯一颜色自定义是更改将颜色应用于所有多边形的全局工具颜色 [colorTools.setToolColor(..)]。

谢谢

4

1 回答 1

0

终于想出了一个解决办法。

// Listening to new measurement tools
// (in our case, this event raises everytime a new ROI is added)
$(canvas).on('cornerstonetoolsmeasurementadded', (e) => {
  // Making sure this is the type is 'freehand' 
  // which is the tool used for drawing ROI
  if (e.detail.toolType == 'freehand')
    // Changing the color.
    e.detail.measurementData.color = this.pickColor
})
于 2018-06-06T09:13:43.857 回答