feat(SM): remove SM measurements from measurement panel (#4022)
This commit is contained in:
1 parent
77693ddef4
commit
df49a653be
21 files changed
+106
-85
No files matched your search
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^1.70.0",
|
||||
"@cornerstonejs/core": "^1.70.0",
|
||||
"@cornerstonejs/adapters": "^1.70.5",
|
||||
"@cornerstonejs/core": "^1.70.5",
|
||||
"@kitware/vtk.js": "30.3.1",
|
||||
"react-color": "^2.19.3"
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^1.70.0",
|
||||
"@cornerstonejs/core": "^1.70.0",
|
||||
"@cornerstonejs/tools": "^1.70.0",
|
||||
"@cornerstonejs/adapters": "^1.70.5",
|
||||
"@cornerstonejs/core": "^1.70.5",
|
||||
"@cornerstonejs/tools": "^1.70.5",
|
||||
"classnames": "^2.3.2"
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/core": "^1.70.0",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^1.70.0",
|
||||
"@cornerstonejs/tools": "^1.70.0",
|
||||
"@cornerstonejs/core": "^1.70.5",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^1.70.5",
|
||||
"@cornerstonejs/tools": "^1.70.5",
|
||||
"classnames": "^2.3.2"
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,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.70.0",
|
||||
"@cornerstonejs/dicom-image-loader": "^1.70.5",
|
||||
"@icr/polyseg-wasm": "^0.4.0",
|
||||
"@ohif/core": "3.8.0-beta.78",
|
||||
"@ohif/ui": "3.8.0-beta.78",
|
||||
@@ -55,10 +55,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^1.70.0",
|
||||
"@cornerstonejs/core": "^1.70.0",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^1.70.0",
|
||||
"@cornerstonejs/tools": "^1.70.0",
|
||||
"@cornerstonejs/adapters": "^1.70.5",
|
||||
"@cornerstonejs/core": "^1.70.5",
|
||||
"@cornerstonejs/streaming-image-volume-loader": "^1.70.5",
|
||||
"@cornerstonejs/tools": "^1.70.5",
|
||||
"@icr/polyseg-wasm": "^0.4.0",
|
||||
"@kitware/vtk.js": "30.3.1",
|
||||
"html2canvas": "^1.4.1",
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
utilities as csUtils,
|
||||
} from '@cornerstonejs/core';
|
||||
import { MeasurementService } from '@ohif/core';
|
||||
import { Notification, useViewportDialog, Types as UITypes, AllInOneMenu } from '@ohif/ui';
|
||||
import { Notification, useViewportDialog, AllInOneMenu } from '@ohif/ui';
|
||||
import { IStackViewport, IVolumeViewport } from '@cornerstonejs/core/dist/esm/types';
|
||||
|
||||
import { setEnabledElement } from '../state';
|
||||
@@ -114,7 +114,6 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
||||
// of the imageData in the OHIFCornerstoneViewport. This prop is used
|
||||
// to set the initial state of the viewport's first image to render
|
||||
initialImageIndex,
|
||||
onReady,
|
||||
} = props;
|
||||
|
||||
const viewportId = viewportOptions.viewportId;
|
||||
@@ -142,7 +141,6 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
||||
viewportGridService,
|
||||
stateSyncService,
|
||||
viewportActionCornersService,
|
||||
customizationService,
|
||||
} = servicesManager.services as CornerstoneServices;
|
||||
|
||||
const [viewportDialogState] = useViewportDialog();
|
||||
@@ -203,7 +201,6 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
||||
|
||||
if (onElementEnabled) {
|
||||
onElementEnabled(evt);
|
||||
onReady?.(evt);
|
||||
}
|
||||
},
|
||||
[viewportId, onElementEnabled, toolGroupService]
|
||||
|
||||
@@ -275,16 +275,16 @@ function commandsModule({
|
||||
|
||||
actions.setViewportWindowLevel({ ...props, viewportId });
|
||||
},
|
||||
setToolEnabled: ({ toolName, toggle }) => {
|
||||
setToolEnabled: ({ toolName, toggle, toolGroupId }) => {
|
||||
const { viewports } = viewportGridService.getState();
|
||||
|
||||
if (!viewports.size) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toolGroup = toolGroupService.getToolGroup(null);
|
||||
const toolGroup = toolGroupService.getToolGroup(toolGroupId ?? null);
|
||||
|
||||
if (!toolGroup) {
|
||||
if (!toolGroup || !toolGroup.hasTool(toolName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -293,6 +293,8 @@ function commandsModule({
|
||||
// Toggle the tool's state only if the toggle is true
|
||||
if (toggle) {
|
||||
toolIsEnabled ? toolGroup.setToolDisabled(toolName) : toolGroup.setToolEnabled(toolName);
|
||||
} else {
|
||||
toolGroup.setToolEnabled(toolName);
|
||||
}
|
||||
|
||||
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
utilities as csUtilities,
|
||||
Enums as csEnums,
|
||||
} from '@cornerstonejs/core';
|
||||
import { utilities } from '@cornerstonejs/tools';
|
||||
import {
|
||||
cornerstoneStreamingImageVolumeLoader,
|
||||
cornerstoneStreamingDynamicImageVolumeLoader,
|
||||
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
PlanarFreehandROITool,
|
||||
SplineROITool,
|
||||
LivewireContourTool,
|
||||
OrientationMarkerTool,
|
||||
} from '@cornerstonejs/tools';
|
||||
|
||||
import CalibrationLineTool from './tools/CalibrationLineTool';
|
||||
@@ -80,6 +81,7 @@ export default function initCornerstoneTools(configuration = {}) {
|
||||
addTool(PlanarFreehandROITool);
|
||||
addTool(SplineROITool);
|
||||
addTool(LivewireContourTool);
|
||||
addTool(OrientationMarkerTool);
|
||||
|
||||
// Modify annotation tools to use dashed lines on SR
|
||||
const annotationStyle = {
|
||||
@@ -132,6 +134,7 @@ const toolNames = {
|
||||
SplineROI: SplineROITool.toolName,
|
||||
LivewireContour: LivewireContourTool.toolName,
|
||||
PlanarFreehandROI: PlanarFreehandROITool.toolName,
|
||||
OrientationMarker: OrientationMarkerTool.toolName,
|
||||
};
|
||||
|
||||
export { toolNames };
|
||||
@@ -1,11 +1,10 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ServicesManager, ExtensionManager, CommandsManager, DicomMetadataStore } from '@ohif/core';
|
||||
import { MeasurementTable, Icon, ButtonGroup, Button } from '@ohif/ui';
|
||||
import { MeasurementTable } from '@ohif/ui';
|
||||
import { withTranslation, WithTranslation } from 'react-i18next';
|
||||
import { EVENTS as MicroscopyEvents } from '../../services/MicroscopyService';
|
||||
import dcmjs from 'dcmjs';
|
||||
import styles from '../../utils/styles';
|
||||
import callInputDialog from '../../utils/callInputDialog';
|
||||
import constructSR from '../../utils/constructSR';
|
||||
import { saveByteArray } from '../../utils/saveByteArray';
|
||||
@@ -286,6 +285,11 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
props.commandsManager.runCommand('setLabel', { uid }, 'MICROSCOPY');
|
||||
};
|
||||
|
||||
const onMeasurementDeleteHandler = ({ uid, isActive }: { uid: string; isActive: boolean }) => {
|
||||
const roiAnnotation = microscopyService.getAnnotation(uid);
|
||||
microscopyService.removeAnnotation(roiAnnotation);
|
||||
};
|
||||
|
||||
// Convert ROI annotations managed by microscopyService into our
|
||||
// own format for display
|
||||
const data = roiAnnotations.map((roiAnnotation, index) => {
|
||||
@@ -322,8 +326,6 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
};
|
||||
});
|
||||
|
||||
const disabled = data.length === 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
@@ -336,6 +338,7 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
data={data}
|
||||
onClick={onMeasurementItemClickHandler}
|
||||
onEdit={onMeasurementItemEditHandler}
|
||||
onDelete={onMeasurementDeleteHandler}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
"start": "yarn run dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cornerstonejs/core": "^1.70.0",
|
||||
"@cornerstonejs/tools": "^1.70.0",
|
||||
"@cornerstonejs/core": "^1.70.5",
|
||||
"@cornerstonejs/tools": "^1.70.5",
|
||||
"@ohif/core": "3.8.0-beta.78",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "3.8.0-beta.78",
|
||||
"@ohif/ui": "3.8.0-beta.78",
|
||||
|
||||
+19
-1
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { Icon, ActionButtons } from '@ohif/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
export default function PanelRoiThresholdSegmentation({ servicesManager, commandsManager }) {
|
||||
const { segmentationService } = servicesManager.services;
|
||||
const { segmentationService, uiNotificationService } = servicesManager.services;
|
||||
const { t } = useTranslation('PanelSUVExport');
|
||||
|
||||
const [segmentations, setSegmentations] = useState(() => segmentationService.getSegmentations());
|
||||
@@ -36,6 +36,24 @@ export default function PanelRoiThresholdSegmentation({ servicesManager, command
|
||||
const tmtvValue = segmentations?.[0]?.cachedStats?.tmtv?.value || null;
|
||||
const config = segmentations?.[0]?.cachedStats?.tmtv?.config || {};
|
||||
|
||||
segmentations.forEach(segmentation => {
|
||||
const { cachedStats } = segmentation;
|
||||
if (!cachedStats) {
|
||||
return;
|
||||
}
|
||||
|
||||
// segment 1
|
||||
const suvPeak = cachedStats?.['1']?.suvPeak?.suvPeak;
|
||||
|
||||
if (Number.isNaN(suvPeak)) {
|
||||
uiNotificationService.show({
|
||||
title: 'Unable to calculate SUV Peak',
|
||||
message: 'The resulting threshold is not big enough.',
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const actions = [
|
||||
{
|
||||
label: 'Export CSV',
|
||||
|
||||
Reference in new issue
Block a user