Add measurement table functions (#415)
* fix(measurements): Add measurement table functions - Support for labeling measurements and adding measurement description - Jump to measurement when clicked on measurement table * fix(layout): Fix the issues with layout when switched with different plugins * fix(measurements): Support for deleting measurements in measurement table * fix(measurements): Add context menu for measurements * fix(dependencies): Bump ohif-core to 0.4.2
This commit is contained in:
1 parent
0bab19985e
commit
c9ddb23d9c
33 files changed
+2219
-151
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import OHIF from 'ohif-core'
|
||||
import cornerstone from 'cornerstone-core'
|
||||
|
||||
export default function updateTableWithNewMeasurementData({
|
||||
toolType,
|
||||
measurementNumber,
|
||||
location,
|
||||
description,
|
||||
}) {
|
||||
// Update all measurements by measurement number
|
||||
const measurementApi = OHIF.measurements.MeasurementApi.Instance
|
||||
const measurements = measurementApi.tools[toolType].filter(
|
||||
m => m.measurementNumber === measurementNumber
|
||||
)
|
||||
|
||||
measurements.forEach(measurement => {
|
||||
measurement.location = location
|
||||
measurement.description = description
|
||||
|
||||
measurementApi.updateMeasurement(measurement.toolType, measurement)
|
||||
})
|
||||
|
||||
measurementApi.syncMeasurementsAndToolData()
|
||||
|
||||
// Update images in all active viewports
|
||||
cornerstone.getEnabledElements().forEach(enabledElement => {
|
||||
cornerstone.updateImage(enabledElement.element)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user