Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: various bugs with regard to tracking workflow #2811

Merged
merged 17 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/cornerstone-3d/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@ohif/core": "^3.0.0",
"@ohif/ui": "^2.0.0",
"cornerstone-wado-image-loader": "^4.1.2",
"dcmjs": "0.22.0",
"dcmjs": "0.24.0",
"dicom-parser": "^1.8.9",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
Expand Down
272 changes: 0 additions & 272 deletions extensions/cornerstone-3d/src/OHIFCornerstone3DViewport.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,9 @@ function _jumpToMeasurement(
viewportGridService.setActiveViewportIndex(viewportIndex);

if (targetElement !== null) {
const metadata = {
...measurement.metadata,
imageIdIndex,
};
cs3DTools.utilities.jumpToSlice(targetElement, metadata);
cs3DTools.utilities.jumpToSlice(targetElement, {
imageIndex: imageIdIndex,
});

cs3DTools.annotation.selection.setAnnotationSelected(measurement.uid);
// Jump to measurement consumed, remove.
Expand Down
7 changes: 1 addition & 6 deletions extensions/cornerstone-3d/src/commandsModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,7 @@ const commandsModule = ({ servicesManager }) => {

const { viewport } = enabledElement;

let options = {};
if (viewport instanceof cornerstone3D.StackViewport) {
options = { direction };
} else {
throw new Error('scroll: volume viewport is not supported yet');
}
const options = { delta: direction };

cornerstone3DTools.utilities.stackScrollTool.scrollThroughStack(
viewport,
Expand Down
4 changes: 4 additions & 0 deletions extensions/cornerstone-3d/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
eventTarget,
EVENTS,
imageLoadPoolManager,
Settings,
} from '@cornerstonejs/core';
import { Enums, utilities } from '@cornerstonejs/tools';

Expand Down Expand Up @@ -36,6 +37,9 @@ export default async function init({
await cs3DInit();
initCornerstoneTools();

// Don't use cursors in viewports
Settings.getRuntimeSettings().set('useCursors', false);
sedghi marked this conversation as resolved.
Show resolved Hide resolved

const {
UserAuthenticationService,
ToolGroupService,
Expand Down
14 changes: 14 additions & 0 deletions extensions/cornerstone-3d/src/initCornerstoneTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ export default function initCornerstone3DTools(configuration = {}) {
cornerstone3DTools.addTool(AngleTool);
cornerstone3DTools.addTool(MagnifyTool);
// cornerstone3DTools.addTool(CrosshairsTool);

// Modify annotation tools to use dashed lines on SR
const annotationStyle = {
textBoxFontSize: '15px',
lineWidth: '1.5',
};

const defaultStyles = cornerstone3DTools.annotation.config.style.getDefaultToolStyles();
cornerstone3DTools.annotation.config.style.setDefaultToolStyles({
global: {
...defaultStyles.global,
...annotationStyle,
},
});
}

const toolNames = {
Expand Down
6 changes: 3 additions & 3 deletions extensions/cornerstone-3d/src/initMeasurementService.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ const connectMeasurementServiceToTools = (
return;
}

const { id, label } = measurement;
const { uid, label } = measurement;

const sourceAnnotation = annotation.state.getAnnotation(id);
const sourceAnnotation = annotation.state.getAnnotation(uid);

if (sourceAnnotation) {
sourceAnnotation.label = label;
sourceAnnotation.data.label = label;
if (sourceAnnotation.hasOwnProperty('text')) {
// Deal with the weird case of ArrowAnnotate.
sourceAnnotation.text = label;
Expand Down
Loading