feat(measurementService): use the new api for annotation manager in cs3d (#3206)

* fix OHIF to use the new api for annotation manager in cs3d

* bump package versions

* fix tests

* remove unnecessary code
This commit is contained in:
Alireza authored and GitHub committed 2023-03-02 17:11:51 -05:00
1 parent 35d0787211
commit 38d452e17d
12 files changed
+40 -43

No files matched your search

+2 -2
View File
@@ -46,7 +46,7 @@
"@babel/runtime": "^7.20.13",
"classnames": "^2.3.2",
"@cornerstonejs/adapters": "^0.3.1",
"@cornerstonejs/core": "^0.31.2",
"@cornerstonejs/tools": "^0.46.2"
"@cornerstonejs/core": "^0.32.0",
"@cornerstonejs/tools": "^0.48.0"
}
}
@@ -48,8 +48,8 @@ export default class DICOMSRDisplayTool extends AnnotationTool {
const { element } = viewport;
let annotations = annotation.state.getAnnotations(
element,
this.getToolName()
this.getToolName(),
element
);
// Todo: We don't need this anymore, filtering happens in triggerAnnotationRender
@@ -43,7 +43,7 @@ export default function addMeasurement(
// Use the metadata provider to grab its imagePlaneModule metadata
const imagePlaneModule = metaData.get('imagePlaneModule', imageId);
const annotationManager = annotation.state.getDefaultAnnotationManager();
const annotationManager = annotation.state.getAnnotationManager();
// Create Cornerstone3D Annotation from measurement
const frameNumber =
@@ -67,7 +67,7 @@ function getFilteredCornerstoneToolState(
const uidFilter = measurementData.map(md => md.uid);
const uids = uidFilter.slice();
const annotationManager = annotation.state.getDefaultAnnotationManager();
const annotationManager = annotation.state.getAnnotationManager();
const framesOfReference = annotationManager.getFramesOfReference();
for (let i = 0; i < framesOfReference.length; i++) {
+3 -3
View File
@@ -44,9 +44,9 @@
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^0.3.1",
"@cornerstonejs/core": "^0.31.2",
"@cornerstonejs/streaming-image-volume-loader": "^0.12.2",
"@cornerstonejs/tools": "^0.46.2",
"@cornerstonejs/core": "^0.32.0",
"@cornerstonejs/streaming-image-volume-loader": "^0.13.0",
"@cornerstonejs/tools": "^0.48.0",
"@kitware/vtk.js": "26.5.6",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
@@ -366,7 +366,7 @@ const connectMeasurementServiceToTools = (
imageId = dataSource.getImageIdsForInstance({ instance });
}
const annotationManager = annotation.state.getDefaultAnnotationManager();
const annotationManager = annotation.state.getAnnotationManager();
annotationManager.addAnnotation({
annotationUID: measurement.uid,
highlighted: false,
@@ -30,10 +30,7 @@ function getFirstAnnotationSelected(element) {
cs3dToolAnnotationUtils.selection.getAnnotationsSelected() || [];
if (selectedAnnotationUID) {
return cs3dToolAnnotationUtils.state.getAnnotation(
selectedAnnotationUID,
element
);
return cs3dToolAnnotationUtils.state.getAnnotation(selectedAnnotationUID);
}
}
+2 -2
View File
@@ -32,8 +32,8 @@
"peerDependencies": {
"@ohif/core": "^3.0.0",
"classnames": "^2.3.2",
"@cornerstonejs/core": "^0.31.2",
"@cornerstonejs/tools": "^0.46.2",
"@cornerstonejs/core": "^0.32.0",
"@cornerstonejs/tools": "^0.48.0",
"@ohif/extension-cornerstone-dicom-sr": "^3.0.0",
"dcmjs": "^0.29.4",
"prop-types": "^15.6.2",
+1 -1
View File
@@ -432,7 +432,7 @@ const commandsModule = ({
},
createTMTVRTReport: () => {
// get all Rectangle ROI annotation
const stateManager = csTools.annotation.state.getDefaultAnnotationManager();
const stateManager = csTools.annotation.state.getAnnotationManager();
const annotations = [];