feat(SM): remove SM measurements from measurement panel (#4022)

This commit is contained in:
Alireza authored and GitHub committed 2024-04-10 13:44:25 -04:00
1 parent 77693ddef4
commit df49a653be
21 files changed
+106 -85

No files matched your search

@@ -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]
+5 -3
View File
@@ -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();
-1
View File
@@ -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 };