Skip to content

Commit

Permalink
fix(invert): allows volume viewport to invert and sync their invert s…
Browse files Browse the repository at this point in the history
…tatus (#3514)
  • Loading branch information
sedghi authored Jul 6, 2023
1 parent f3a4f86 commit 4a184d0
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 64 deletions.
6 changes: 3 additions & 3 deletions extensions/cornerstone-dicom-sr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.2.8",
"@cornerstonejs/core": "^1.2.8",
"@cornerstonejs/tools": "^1.2.8",
"@cornerstonejs/adapters": "^1.4.1",
"@cornerstonejs/core": "^1.4.1",
"@cornerstonejs/tools": "^1.4.1",
"classnames": "^2.3.2"
}
}
10 changes: 5 additions & 5 deletions extensions/cornerstone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.2.8",
"@cornerstonejs/dicom-image-loader": "^1.4.1",
"@ohif/core": "3.7.0-beta.26",
"@ohif/ui": "3.7.0-beta.26",
"dcmjs": "^0.29.6",
Expand All @@ -52,10 +52,10 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.2.8",
"@cornerstonejs/core": "^1.2.8",
"@cornerstonejs/streaming-image-volume-loader": "^1.2.8",
"@cornerstonejs/tools": "^1.2.8",
"@cornerstonejs/adapters": "^1.4.1",
"@cornerstonejs/core": "^1.4.1",
"@cornerstonejs/streaming-image-volume-loader": "^1.4.1",
"@cornerstonejs/tools": "^1.4.1",
"@kitware/vtk.js": "27.3.1",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
Expand Down
8 changes: 3 additions & 5 deletions extensions/cornerstone/src/commandsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,9 @@ function commandsModule({

const { viewport } = enabledElement;

if (viewport instanceof StackViewport) {
const { invert } = viewport.getProperties();
viewport.setProperties({ invert: !invert });
viewport.render();
}
const { invert } = viewport.getProperties();
viewport.setProperties({ invert: !invert });
viewport.render();
},
resetViewport: () => {
const enabledElement = _getActiveViewportEnabledElement();
Expand Down
6 changes: 2 additions & 4 deletions extensions/cornerstone/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import nthLoader from './utils/nthLoader';
import interleaveTopToBottom from './utils/interleaveTopToBottom';
import initContextMenu from './initContextMenu';
import initDoubleClick from './initDoubleClick';
import { CornerstoneServices } from './types';

// TODO: Cypress tests are currently grabbing this from the window?
window.cornerstone = cornerstone;
Expand Down Expand Up @@ -69,10 +70,7 @@ export default async function init({

const {
userAuthenticationService,
measurementService,
customizationService,
displaySetService,
uiDialogService,
uiModalService,
uiNotificationService,
cineService,
Expand All @@ -81,7 +79,7 @@ export default async function init({
toolGroupService,
viewportGridService,
stateSyncService,
} = servicesManager.services;
} = servicesManager.services as CornerstoneServices;

window.services = servicesManager.services;
window.extensionManager = extensionManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const EVENTS = {
* sync group declared.
*/
export type SyncCreator = (
type: string,
id: string,
options?: Record<string, unknown>
) => Synchronizer;

Expand Down Expand Up @@ -83,7 +83,7 @@ export default class SyncGroupService {
* @param type is the type of the synchronizer to create
* @param creator
*/
public setSynchronizer(type: string, creator: SyncCreator): void {
public addSynchronizerType(type: string, creator: SyncCreator): void {
this.synchronizerCreators[type.toLowerCase()] = creator;
}

Expand Down
10 changes: 5 additions & 5 deletions extensions/cornerstone/src/types/CornerstoneServices.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Types } from '@ohif/core';
import ToolGroupService from './services/ToolGroupService';
import SyncGroupService from './services/SyncGroupService';
import SegmentationService from './services/SegmentationService';
import CornerstoneCacheService from './services/CornerstoneCacheService';
import CornerstoneViewportService from './services/ViewportService/CornerstoneViewportService';
import ToolGroupService from '../services/ToolGroupService';
import SyncGroupService from '../services/SyncGroupService';
import SegmentationService from '../services/SegmentationService';
import CornerstoneCacheService from '../services/CornerstoneCacheService';
import CornerstoneViewportService from '../services/ViewportService/CornerstoneViewportService';

interface CornerstoneServices extends Types.Services {
cornerstoneViewportService: CornerstoneViewportService;
Expand Down
4 changes: 2 additions & 2 deletions extensions/measurement-tracking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@cornerstonejs/core": "^1.2.8",
"@cornerstonejs/tools": "^1.2.8",
"@cornerstonejs/core": "^1.4.1",
"@cornerstonejs/tools": "^1.4.1",
"@ohif/core": "3.7.0-beta.26",
"@ohif/extension-cornerstone-dicom-sr": "3.7.0-beta.26",
"@ohif/ui": "3.7.0-beta.26",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
]
},
"resolutions": {
"@cornerstonejs/core": "^1.2.8",
"**/@babel/runtime": "^7.20.13",
"commander": "8.3.0",
"nth-check": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion platform/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.2.8",
"@cornerstonejs/dicom-image-loader": "^1.4.1",
"@ohif/core": "3.7.0-beta.26",
"@ohif/extension-cornerstone": "3.7.0-beta.26",
"@ohif/extension-cornerstone-dicom-rt": "3.7.0-beta.26",
Expand Down
2 changes: 1 addition & 1 deletion platform/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.2.8",
"@cornerstonejs/dicom-image-loader": "^1.4.1",
"@ohif/ui": "3.7.0-beta.26",
"cornerstone-math": "0.1.9",
"dicom-parser": "^1.8.21"
Expand Down
24 changes: 12 additions & 12 deletions platform/core/src/types/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ import {
* The interface for the services object
*/
export default interface Services {
userAuthenticationService?: Record<string, unknown>;
hangingProtocolService?: HangingProtocolService;
customizationService?: CustomizationService;
measurementService?: MeasurementService;
displaySetService?: DisplaySetService;
cineService?: Record<string, unknown>;
toolbarService?: ToolbarService;
cornerstoneViewportService?: Record<string, unknown>;
uiDialogService?: Record<string, unknown>;
toolGroupService?: Record<string, unknown>;
uiNotificationService?: UINotificationService;
uiModalService?: UIModalService;
uiViewportDialogService?: Record<string, unknown>;
viewportGridService?: ViewportGridService;
syncGroupService?: Record<string, unknown>;
cornerstoneCacheService?: Record<string, unknown>;
segmentationService?: Record<string, unknown>;
uiModalService?: UIModalService;
uiNotificationService?: UINotificationService;
stateSyncService?: StateSyncService;
panelService?: Record<string, unknown>;
cineService?: unknown;
userAuthenticationService?: unknown;
cornerstoneViewportService?: unknown;
uiDialogService?: unknown;
toolGroupService?: unknown;
uiViewportDialogService?: unknown;
syncGroupService?: unknown;
cornerstoneCacheService?: unknown;
segmentationService?: unknown;
panelService?: unknown;
}
46 changes: 23 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1589,10 +1589,10 @@
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==

"@cornerstonejs/adapters@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.2.8.tgz#26e584971b917dd099a73511abde32f236655915"
integrity sha512-W1PD+XJ69nUEM5D1wZMyJxRNsKTxWSwtJ6gZ1LH19f7uLSIt1OdKq3PoUZ0KyUiDeP585+NPChquGO14vn8eQA==
"@cornerstonejs/adapters@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.4.1.tgz#48ca911cb76c2c6dfaab3c7c1119bf0fb400bb71"
integrity sha512-w/5c8/m7GKTGFw33vJh5IK3aJNOq9gBeQu0BSAczCBh6DfVY4JWw+ZNUZk2qRYsIcs5rIWSY0/Ykwsq3ziAblA==
dependencies:
"@babel/runtime-corejs2" "^7.17.8"
dcmjs "^0.29.5"
Expand Down Expand Up @@ -1640,43 +1640,43 @@
resolved "https://registry.yarnpkg.com/@cornerstonejs/codec-openjph/-/codec-openjph-2.4.2.tgz#e96721d56f6ec96f7f95c16321d88cc8467d8d81"
integrity sha512-lgdvBvvNezleY+4pIe2ceUsJzlZe/0PipdeubQ3vZZOz3xxtHHMR1XFCl4fgd8gosR8COHuD7h6q+MwgrwBsng==

"@cornerstonejs/core@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.2.8.tgz#e84ecf74cba66085f342a03965f3d73111bb4948"
integrity sha512-7RPIxXiMt9Ud5PWZ3+fVYJRhCzObbb4emaQvQ3dPo30xLyU7EcNDEyLjIezJfJHAMOHKQo9SnsoUQz+8YmdXSQ==
"@cornerstonejs/core@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.4.1.tgz#e7a2de14160545382771a8dbaf64935f9c654904"
integrity sha512-0pDTy4QZdaXISfs1SW04XitUmv5rn874P0M4XiEwNvP05AEr/Ib6yV95yvQD+xaq35JyEjDS0xCSEL4w9W7TmQ==
dependencies:
"@kitware/vtk.js" "27.3.1"
detect-gpu "^5.0.22"
gl-matrix "^3.4.3"
lodash.clonedeep "4.5.0"

"@cornerstonejs/dicom-image-loader@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.2.8.tgz#61cd310310f1cd8d0837135240928e18f5d63c0f"
integrity sha512-w/JrforcHUvVPXEmxT015cGb/IT+py2rTKXk5udqyX/dLoI1q8FaqHFq8z/pN+9AXsUrdQ2d7gmXTpDihS8b4Q==
"@cornerstonejs/dicom-image-loader@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.4.1.tgz#41ba4531e87827b83684e9de939ef5025eb53db2"
integrity sha512-J47sWG8iEISc+mSsn8iw4Fi1GL4mGuHUD+UegcGl7SgTVA6xmtEoVJJJ7lcfmPxsLJfzRv3x3Okc25GdugE8Bw==
dependencies:
"@cornerstonejs/codec-charls" "^1.2.3"
"@cornerstonejs/codec-libjpeg-turbo-8bit" "^1.2.2"
"@cornerstonejs/codec-openjpeg" "^1.2.2"
"@cornerstonejs/codec-openjph" "^2.4.2"
"@cornerstonejs/core" "^1.2.8"
"@cornerstonejs/core" "^1.4.1"
dicom-parser "^1.8.9"
pako "^2.0.4"
uuid "^9.0.0"

"@cornerstonejs/streaming-image-volume-loader@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.2.8.tgz#fcbc6de46c45968e7806f8e322f0605cac4a4b85"
integrity sha512-/FWbWglSNIKgV0ZUDQrkCQkg+Dzf85ReH+svqg8sBhCiCKSdKSAQXEaDG471O+nmVdNg7VW8DE8PwA/yVe/3yA==
"@cornerstonejs/streaming-image-volume-loader@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.4.1.tgz#7377add2ee2567793dadc4cce74012b95a201eed"
integrity sha512-dwW1IrunYoSo+UM55zpY+KIcC573YOKgCJrcy/AL6kwIJnuglmFMSzeJLM+xxdprbod2QP3LMWwpz0ikfGy67w==
dependencies:
"@cornerstonejs/core" "^1.2.8"
"@cornerstonejs/core" "^1.4.1"

"@cornerstonejs/tools@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.2.8.tgz#8979a40cf53a4a2a648ef8c0fc24ef15603a0f9a"
integrity sha512-E3+UOgl/DRNvvxTJziMoEa6uudKSGr/JFL5k9HvjU2HtGm4kdpYNo9lGnsTqeuUZ2xrPnUZFLYHVwF1WVegoEw==
"@cornerstonejs/tools@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.4.1.tgz#2ea8ab701ecf93ed9d02dcd5b95ea810bcfa98a8"
integrity sha512-UfwWzmJT3aKu2gvlWQZ3ZLmof8krRYyk0L/HTsTglS2izzbjIPuMAPfh5+FrTIhLE1RQmGwujCp7UZRIEa9s/w==
dependencies:
"@cornerstonejs/core" "^1.2.8"
"@cornerstonejs/core" "^1.4.1"
lodash.clonedeep "4.5.0"
lodash.get "^4.4.2"

Expand Down

0 comments on commit 4a184d0

Please sign in to comment.