Skip to content

Commit

Permalink
feat: Add events to RoiThresholdManual tool
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi authored and swederik committed Mar 22, 2022
1 parent 8e09a84 commit 890cc58
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {
StackViewport,
metaData,
Types,
triggerEvent,
eventTarget,
} from '@precisionmetrics/cornerstone-render'
import { vec3 } from 'gl-matrix'
import { CornerstoneTools3DEvents as EVENTS } from '../../enums'
import {
getImageIdForTool,
getSpacingInNormalDirection,
Expand Down Expand Up @@ -225,7 +228,7 @@ export default class RectangleRoiThresholdManualTool extends RectangleRoiTool {
// return
// }

const { viewport } = enabledElement
const { viewport, sceneUID, renderingEngineUID } = enabledElement
const sliceIndex = viewport.getCurrentImageIdIndex()

for (let i = 0; i < toolState.length; i++) {
Expand Down Expand Up @@ -256,6 +259,16 @@ export default class RectangleRoiThresholdManualTool extends RectangleRoiTool {
continue
}

const eventType = EVENTS.MEASUREMENT_MODIFIED

const eventDetail = {
toolData,
viewportUID: viewport.uid,
sceneUID: sceneUID,
renderingEngineUID,
}
triggerEvent(eventTarget, eventType, eventDetail)

// if it is inside the start/end slice, but not exactly the first or
// last slice, we render the line in dash, but not the handles
let firstOrLastSlice = false
Expand Down

0 comments on commit 890cc58

Please sign in to comment.