fix(Measurement): Use dashed lines for measurments of viewports where getCurrentImageId returns undefined (#3392)
* fix(Measurement): Use dashed lines for measurments of viewports where getCurrentImageId returns undefined * Updated cornerstone3d packages * Fixed code comment. * Removed unused imports.
This commit is contained in:
1 parent
52eb0edd6f
commit
045e54aa02
8 files changed
+42
-43
No files matched your search
@@ -46,7 +46,7 @@
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"classnames": "^2.3.2",
|
||||
"@cornerstonejs/adapters": "^0.6.0",
|
||||
"@cornerstonejs/core": "^0.46.2",
|
||||
"@cornerstonejs/tools": "^0.67.2"
|
||||
"@cornerstonejs/core": "^0.47.1",
|
||||
"@cornerstonejs/tools": "^0.67.4"
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
"peerDependencies": {
|
||||
"@ohif/core": "^3.0.0",
|
||||
"@ohif/ui": "^2.0.0",
|
||||
"@cornerstonejs/dicom-image-loader": "^0.6.4",
|
||||
"@cornerstonejs/dicom-image-loader": "^0.6.6",
|
||||
"@cornerstonejs/codec-charls": "^1.2.3",
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "^1.2.2",
|
||||
@@ -53,9 +53,9 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^0.6.0",
|
||||
"@cornerstonejs/core": "^0.46.2",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^0.20.2",
|
||||
"@cornerstonejs/tools": "^0.67.2",
|
||||
"@cornerstonejs/core": "^0.47.1",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^0.20.4",
|
||||
"@cornerstonejs/tools": "^0.67.4",
|
||||
"@kitware/vtk.js": "27.3.1",
|
||||
"html2canvas": "^1.4.1",
|
||||
"lodash.debounce": "4.0.8",
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
"peerDependencies": {
|
||||
"@ohif/core": "^3.0.0",
|
||||
"classnames": "^2.3.2",
|
||||
"@cornerstonejs/core": "^0.46.2",
|
||||
"@cornerstonejs/tools": "^0.67.2",
|
||||
"@cornerstonejs/core": "^0.47.1",
|
||||
"@cornerstonejs/tools": "^0.67.4",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "^3.0.0",
|
||||
"dcmjs": "^0.29.5",
|
||||
"lodash.debounce": "^4.17.21",
|
||||
|
||||
@@ -2,13 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF, { utils } from '@ohif/core';
|
||||
|
||||
import {
|
||||
Notification,
|
||||
ViewportActionBar,
|
||||
useViewportDialog,
|
||||
Tooltip,
|
||||
Icon,
|
||||
} from '@ohif/ui';
|
||||
import { ViewportActionBar, Tooltip, Icon } from '@ohif/ui';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -19,13 +13,11 @@ const { formatDate } = utils;
|
||||
|
||||
function TrackedCornerstoneViewport(props) {
|
||||
const {
|
||||
children,
|
||||
displaySets,
|
||||
viewportIndex,
|
||||
viewportLabel,
|
||||
servicesManager,
|
||||
extensionManager,
|
||||
commandsManager,
|
||||
viewportOptions,
|
||||
} = props;
|
||||
|
||||
@@ -40,7 +32,6 @@ function TrackedCornerstoneViewport(props) {
|
||||
const displaySet = displaySets[0];
|
||||
|
||||
const [trackedMeasurements] = useTrackedMeasurements();
|
||||
const [viewportDialogState] = useViewportDialog();
|
||||
const [isTracked, setIsTracked] = useState(false);
|
||||
const [trackedMeasurementUID, setTrackedMeasurementUID] = useState(null);
|
||||
|
||||
@@ -48,7 +39,6 @@ function TrackedCornerstoneViewport(props) {
|
||||
const viewportId = viewportOptions.viewportId;
|
||||
|
||||
const {
|
||||
Modality,
|
||||
SeriesDate,
|
||||
SeriesDescription,
|
||||
SeriesInstanceUID,
|
||||
@@ -93,8 +83,17 @@ function TrackedCornerstoneViewport(props) {
|
||||
};
|
||||
}, [isTracked]);
|
||||
|
||||
if (trackedSeries.includes(SeriesInstanceUID) !== isTracked) {
|
||||
setIsTracked(!isTracked);
|
||||
// A current image id will only exist for viewports that can have measurements tracked.
|
||||
// Typically these are stack viewports and those volume viewports for the series of acquisition.
|
||||
const currentImageId = cornerstoneViewportService
|
||||
.getCornerstoneViewport(viewportId)
|
||||
?.getCurrentImageId();
|
||||
if (currentImageId) {
|
||||
if (trackedSeries.includes(SeriesInstanceUID) !== isTracked) {
|
||||
setIsTracked(!isTracked);
|
||||
}
|
||||
} else if (isTracked) {
|
||||
setIsTracked(false);
|
||||
}
|
||||
|
||||
function switchMeasurement(direction) {
|
||||
|
||||
Reference in new issue
Block a user