Skip to content

Commit

Permalink
Merge branch 'master' into fix_arroaannotate_validation_error
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi authored Nov 9, 2023
2 parents f3a79ad + 4bbba87 commit a4b75f0
Show file tree
Hide file tree
Showing 60 changed files with 671 additions and 156 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.8.0-beta.12](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.11...v3.8.0-beta.12) (2023-11-08)


### Features

* add VolumeViewport rotation ([#3776](https://github.com/OHIF/Viewers/issues/3776)) ([442f99d](https://github.com/OHIF/Viewers/commit/442f99d5eb2ceece7def20e14da59af1dd7d8442))





# [3.8.0-beta.11](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.10...v3.8.0-beta.11) (2023-11-08)


### Features

* **hp callback:** Add viewport ready callback ([#3772](https://github.com/OHIF/Viewers/issues/3772)) ([bf252bc](https://github.com/OHIF/Viewers/commit/bf252bcec2aae3a00479fdcb732110b344bcf2c0))





# [3.8.0-beta.10](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.9...v3.8.0-beta.10) (2023-11-03)

**Note:** Version bump only for package ohif-monorepo-root
Expand Down
2 changes: 1 addition & 1 deletion commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ee67bcc0f55450ccddaa543389180f505e121af5
442f99d5eb2ceece7def20e14da59af1dd7d8442
16 changes: 16 additions & 0 deletions extensions/cornerstone-dicom-rt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.8.0-beta.12](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.11...v3.8.0-beta.12) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-rt





# [3.8.0-beta.11](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.10...v3.8.0-beta.11) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-rt





# [3.8.0-beta.10](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.9...v3.8.0-beta.10) (2023-11-03)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-rt
Expand Down
10 changes: 5 additions & 5 deletions extensions/cornerstone-dicom-rt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-rt",
"version": "3.8.0-beta.10",
"version": "3.8.0-beta.12",
"description": "DICOM RT read workflow",
"author": "OHIF",
"license": "MIT",
Expand Down Expand Up @@ -31,10 +31,10 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "3.8.0-beta.10",
"@ohif/extension-cornerstone": "3.8.0-beta.10",
"@ohif/extension-default": "3.8.0-beta.10",
"@ohif/i18n": "3.8.0-beta.10",
"@ohif/core": "3.8.0-beta.12",
"@ohif/extension-cornerstone": "3.8.0-beta.12",
"@ohif/extension-default": "3.8.0-beta.12",
"@ohif/i18n": "3.8.0-beta.12",
"prop-types": "^15.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
16 changes: 16 additions & 0 deletions extensions/cornerstone-dicom-seg/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.8.0-beta.12](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.11...v3.8.0-beta.12) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-seg





# [3.8.0-beta.11](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.10...v3.8.0-beta.11) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-seg





# [3.8.0-beta.10](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.9...v3.8.0-beta.10) (2023-11-03)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-seg
Expand Down
10 changes: 5 additions & 5 deletions extensions/cornerstone-dicom-seg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-seg",
"version": "3.8.0-beta.10",
"version": "3.8.0-beta.12",
"description": "DICOM SEG read workflow",
"author": "OHIF",
"license": "MIT",
Expand Down Expand Up @@ -31,10 +31,10 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "3.8.0-beta.10",
"@ohif/extension-cornerstone": "3.8.0-beta.10",
"@ohif/extension-default": "3.8.0-beta.10",
"@ohif/i18n": "3.8.0-beta.10",
"@ohif/core": "3.8.0-beta.12",
"@ohif/extension-cornerstone": "3.8.0-beta.12",
"@ohif/extension-default": "3.8.0-beta.12",
"@ohif/i18n": "3.8.0-beta.12",
"prop-types": "^15.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
16 changes: 16 additions & 0 deletions extensions/cornerstone-dicom-sr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.8.0-beta.12](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.11...v3.8.0-beta.12) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-sr





# [3.8.0-beta.11](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.10...v3.8.0-beta.11) (2023-11-08)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-sr





# [3.8.0-beta.10](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.9...v3.8.0-beta.10) (2023-11-03)

**Note:** Version bump only for package @ohif/extension-cornerstone-dicom-sr
Expand Down
10 changes: 5 additions & 5 deletions extensions/cornerstone-dicom-sr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-sr",
"version": "3.8.0-beta.10",
"version": "3.8.0-beta.12",
"description": "OHIF extension for an SR Cornerstone Viewport",
"author": "OHIF",
"license": "MIT",
Expand Down Expand Up @@ -32,10 +32,10 @@
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
},
"peerDependencies": {
"@ohif/core": "3.8.0-beta.10",
"@ohif/extension-cornerstone": "3.8.0-beta.10",
"@ohif/extension-measurement-tracking": "3.8.0-beta.10",
"@ohif/ui": "3.8.0-beta.10",
"@ohif/core": "3.8.0-beta.12",
"@ohif/extension-cornerstone": "3.8.0-beta.12",
"@ohif/extension-measurement-tracking": "3.8.0-beta.12",
"@ohif/ui": "3.8.0-beta.12",
"dcmjs": "^0.29.12",
"dicom-parser": "^1.8.9",
"hammerjs": "^2.0.8",
Expand Down
22 changes: 22 additions & 0 deletions extensions/cornerstone/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.8.0-beta.12](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.11...v3.8.0-beta.12) (2023-11-08)


### Features

* add VolumeViewport rotation ([#3776](https://github.com/OHIF/Viewers/issues/3776)) ([442f99d](https://github.com/OHIF/Viewers/commit/442f99d5eb2ceece7def20e14da59af1dd7d8442))





# [3.8.0-beta.11](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.10...v3.8.0-beta.11) (2023-11-08)


### Features

* **hp callback:** Add viewport ready callback ([#3772](https://github.com/OHIF/Viewers/issues/3772)) ([bf252bc](https://github.com/OHIF/Viewers/commit/bf252bcec2aae3a00479fdcb732110b344bcf2c0))





# [3.8.0-beta.10](https://github.com/OHIF/Viewers/compare/v3.8.0-beta.9...v3.8.0-beta.10) (2023-11-03)

**Note:** Version bump only for package @ohif/extension-cornerstone
Expand Down
8 changes: 4 additions & 4 deletions extensions/cornerstone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone",
"version": "3.8.0-beta.10",
"version": "3.8.0-beta.12",
"description": "OHIF extension for Cornerstone",
"author": "OHIF",
"license": "MIT",
Expand Down Expand Up @@ -37,9 +37,9 @@
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.27.3",
"@ohif/core": "3.8.0-beta.10",
"@ohif/ui": "3.8.0-beta.10",
"dcmjs": "^0.29.11",
"@ohif/core": "3.8.0-beta.12",
"@ohif/ui": "3.8.0-beta.12",
"dcmjs": "^0.29.12",
"dicom-parser": "^1.8.21",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
Expand Down
36 changes: 33 additions & 3 deletions extensions/cornerstone/src/commandsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
StackViewport,
VolumeViewport,
utilities as csUtils,
Types as CoreTypes,
BaseVolumeViewport,
} from '@cornerstonejs/core';
import {
ToolGroupManager,
Expand All @@ -11,6 +13,7 @@ import {
ReferenceLinesTool,
} from '@cornerstonejs/tools';
import { Types as OhifTypes } from '@ohif/core';
import { vec3, mat4 } from 'gl-matrix';

import CornerstoneViewportDownloadForm from './utils/CornerstoneViewportDownloadForm';
import callInputDialog from './utils/callInputDialog';
Expand Down Expand Up @@ -391,8 +394,16 @@ function commandsModule({

const { viewport } = enabledElement;

if (viewport instanceof StackViewport) {
const { rotation: currentRotation } = viewport.getProperties();
if (viewport instanceof BaseVolumeViewport) {
const camera = viewport.getCamera();
const rotAngle = (rotation * Math.PI) / 180;
const rotMat = mat4.identity(new Float32Array(16));
mat4.rotate(rotMat, rotMat, rotAngle, camera.viewPlaneNormal);
const rotatedViewUp = vec3.transformMat4(vec3.create(), camera.viewUp, rotMat);
viewport.setCamera({ viewUp: rotatedViewUp as CoreTypes.Point3 });
viewport.render();
} else if (viewport.getRotation !== undefined) {
const currentRotation = viewport.getRotation();
const newRotation = (currentRotation + rotation) % 360;
viewport.setProperties({ rotation: newRotation });
viewport.render();
Expand Down Expand Up @@ -580,6 +591,23 @@ function commandsModule({
storePresentation: ({ viewportId }) => {
cornerstoneViewportService.storePresentation({ viewportId });
},

attachProtocolViewportDataListener: ({ protocol, stageIndex }) => {
const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED;
const command = protocol.callbacks.onViewportDataInitialized;
const numPanes = protocol.stages?.[stageIndex]?.viewports.length ?? 1;
let numPanesWithData = 0;
const { unsubscribe } = cornerstoneViewportService.subscribe(EVENT, evt => {
numPanesWithData++;

if (numPanesWithData === numPanes) {
commandsManager.run(...command);

// Unsubscribe from the event
unsubscribe(EVENT);
}
});
},
};

const definitions = {
Expand All @@ -606,7 +634,6 @@ function commandsModule({
storeContexts: [],
options: {},
},

deleteMeasurement: {
commandFn: actions.deleteMeasurement,
},
Expand Down Expand Up @@ -714,6 +741,9 @@ function commandsModule({
cleanUpCrosshairs: {
commandFn: actions.cleanUpCrosshairs,
},
attachProtocolViewportDataListener: {
commandFn: actions.attachProtocolViewportDataListener,
},
};

return {
Expand Down
Loading

0 comments on commit a4b75f0

Please sign in to comment.