fix: Delete study measurements instead of all measurements (#4882)
This commit is contained in:
1 parent
165c9dc710
commit
8e47112d8e
16 files changed
+237
-232
No files matched your search
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/adapters": "^3.7.8",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"react-color": "^2.19.3"
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/adapters": "^3.7.8",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"react-color": "^2.19.3"
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/tools": "^3.7.5",
|
||||
"@cornerstonejs/adapters": "^3.7.8",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@cornerstonejs/tools": "^3.7.8",
|
||||
"classnames": "^2.3.2"
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/tools": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@cornerstonejs/tools": "^3.7.8",
|
||||
"classnames": "^2.3.2"
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "^1.2.4",
|
||||
"@cornerstonejs/codec-openjph": "^2.4.5",
|
||||
"@cornerstonejs/dicom-image-loader": "^3.7.5",
|
||||
"@cornerstonejs/dicom-image-loader": "^3.7.8",
|
||||
"@ohif/core": "3.10.0-beta.134",
|
||||
"@ohif/ui": "3.10.0-beta.134",
|
||||
"dcmjs": "*",
|
||||
@@ -51,11 +51,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/labelmap-interpolation": "^3.7.5",
|
||||
"@cornerstonejs/polymorphic-segmentation": "^3.7.5",
|
||||
"@cornerstonejs/tools": "^3.7.5",
|
||||
"@cornerstonejs/adapters": "^3.7.8",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@cornerstonejs/labelmap-interpolation": "^3.7.8",
|
||||
"@cornerstonejs/polymorphic-segmentation": "^3.7.8",
|
||||
"@cornerstonejs/tools": "^3.7.8",
|
||||
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"html2canvas": "^1.4.1",
|
||||
|
||||
@@ -888,6 +888,9 @@ function commandsModule({
|
||||
},
|
||||
scroll: (options: ToolTypes.ScrollOptions) => {
|
||||
const enabledElement = _getActiveViewportEnabledElement();
|
||||
// Allow either or direction for consistency in scroll implementation
|
||||
options.delta ??= options.direction || 1;
|
||||
options.direction ??= options.delta;
|
||||
|
||||
if (!enabledElement) {
|
||||
return;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import React from 'react';
|
||||
import { useActiveViewportDisplaySets, useSystem } from '@ohif/core';
|
||||
import { useActiveViewportDisplaySets, useSystem, utils } from '@ohif/core';
|
||||
// import { AccordionContent, AccordionItem, AccordionTrigger } from '@ohif/ui-next';
|
||||
|
||||
import { AccordionGroup } from './AccordionGroup';
|
||||
import MeasurementsOrAdditionalFindings from './MeasurementsOrAdditionalFindings';
|
||||
import StudySummaryWithActions from './StudySummaryWithActions';
|
||||
|
||||
const { MeasurementFilters } = utils;
|
||||
|
||||
/**
|
||||
* Groups measurements by study in order to allow display and saving by study
|
||||
* @param {Object} servicesManager
|
||||
@@ -26,6 +28,10 @@ export const groupByStudy = (items, grouping, childProps) => {
|
||||
const studyUID = getItemStudyInstanceUID(item);
|
||||
if (!groups.has(studyUID)) {
|
||||
const items = [];
|
||||
const filter = MeasurementFilters.filterAnd(
|
||||
MeasurementFilters.filterMeasurementsByStudyUID(activeStudyUID),
|
||||
grouping.filter
|
||||
);
|
||||
const group = {
|
||||
...grouping,
|
||||
items,
|
||||
@@ -33,6 +39,8 @@ export const groupByStudy = (items, grouping, childProps) => {
|
||||
key: studyUID,
|
||||
isSelected: studyUID === activeStudyUID,
|
||||
StudyInstanceUID: activeStudyUID,
|
||||
filter,
|
||||
measurementFilter: filter,
|
||||
};
|
||||
if (group.isSelected && !firstSelected) {
|
||||
firstSelected = group;
|
||||
|
||||
@@ -58,12 +58,7 @@ import StudyMeasurements from '../components/StudyMeasurements';
|
||||
*```
|
||||
*/
|
||||
export default function PanelMeasurement(props): React.ReactNode {
|
||||
const {
|
||||
measurementFilter,
|
||||
emptyComponent: EmptyComponent,
|
||||
key = 'PanelMeasurement',
|
||||
children,
|
||||
} = props;
|
||||
const { measurementFilter, emptyComponent: EmptyComponent, children } = props;
|
||||
|
||||
const system = useSystem();
|
||||
const displayMeasurements = useMeasurements(system.servicesManager, {
|
||||
@@ -72,11 +67,7 @@ export default function PanelMeasurement(props): React.ReactNode {
|
||||
|
||||
if (!displayMeasurements.length) {
|
||||
return EmptyComponent ? (
|
||||
<EmptyComponent
|
||||
key={key}
|
||||
data-cy={key}
|
||||
items={displayMeasurements}
|
||||
/>
|
||||
<EmptyComponent items={displayMeasurements} />
|
||||
) : (
|
||||
<span className="text-white">No Measurements</span>
|
||||
);
|
||||
@@ -87,17 +78,10 @@ export default function PanelMeasurement(props): React.ReactNode {
|
||||
React.cloneElement(child, {
|
||||
items: displayMeasurements,
|
||||
filter: measurementFilter,
|
||||
'data-cy': key,
|
||||
})
|
||||
);
|
||||
return cloned;
|
||||
}
|
||||
// Need to merge defaults on the content props to ensure they get passed to children
|
||||
return (
|
||||
<StudyMeasurements
|
||||
key={key}
|
||||
data-cy={key}
|
||||
items={displayMeasurements}
|
||||
/>
|
||||
);
|
||||
return <StudyMeasurements items={displayMeasurements} />;
|
||||
}
|
||||
@@ -32,8 +32,8 @@
|
||||
"start": "yarn run dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cornerstonejs/core": "^3.7.5",
|
||||
"@cornerstonejs/tools": "^3.7.5",
|
||||
"@cornerstonejs/core": "^3.7.8",
|
||||
"@cornerstonejs/tools": "^3.7.8",
|
||||
"@ohif/core": "3.10.0-beta.134",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "3.10.0-beta.134",
|
||||
"@ohif/extension-default": "3.10.0-beta.134",
|
||||
|
||||
@@ -24,12 +24,14 @@ function PanelMeasurementTableTracking(props) {
|
||||
: filterPlanarMeasurement;
|
||||
|
||||
const EmptyComponent = () => (
|
||||
<MeasurementTable
|
||||
title="Measurements"
|
||||
isExpanded={false}
|
||||
>
|
||||
<MeasurementTable.Body />
|
||||
</MeasurementTable>
|
||||
<div data-cy="trackedMeasurements-panel">
|
||||
<MeasurementTable
|
||||
title="Measurements"
|
||||
isExpanded={false}
|
||||
>
|
||||
<MeasurementTable.Body />
|
||||
</MeasurementTable>
|
||||
</div>
|
||||
);
|
||||
|
||||
const actions = {
|
||||
@@ -55,27 +57,29 @@ function PanelMeasurementTableTracking(props) {
|
||||
);
|
||||
|
||||
return (
|
||||
<PanelMeasurement
|
||||
measurementFilter={measurementFilter}
|
||||
emptyComponent={EmptyComponent}
|
||||
sourceChildren={props.children}
|
||||
>
|
||||
<StudyMeasurements grouping={props.grouping}>
|
||||
<AccordionGroup.Trigger
|
||||
key="trackingMeasurementsHeader"
|
||||
asChild={true}
|
||||
>
|
||||
<div data-cy="trackedMeasurements-panel">
|
||||
<PanelMeasurement
|
||||
measurementFilter={measurementFilter}
|
||||
emptyComponent={EmptyComponent}
|
||||
sourceChildren={props.children}
|
||||
>
|
||||
<StudyMeasurements grouping={props.grouping}>
|
||||
<AccordionGroup.Trigger
|
||||
key="trackingMeasurementsHeader"
|
||||
asChild={true}
|
||||
>
|
||||
<Header key="trackingHeadChild" />
|
||||
</AccordionGroup.Trigger>
|
||||
<MeasurementsOrAdditionalFindings
|
||||
key="measurementsOrAdditionalFindings"
|
||||
activeStudyUID={trackedStudy}
|
||||
customHeader={StudyMeasurementsActions}
|
||||
measurementFilter={measurementFilter}
|
||||
actions={actions}
|
||||
/>
|
||||
</StudyMeasurements>
|
||||
</PanelMeasurement>
|
||||
</AccordionGroup.Trigger>
|
||||
<MeasurementsOrAdditionalFindings
|
||||
key="measurementsOrAdditionalFindings"
|
||||
activeStudyUID={trackedStudy}
|
||||
customHeader={StudyMeasurementsActions}
|
||||
measurementFilter={measurementFilter}
|
||||
actions={actions}
|
||||
/>
|
||||
</StudyMeasurements>
|
||||
</PanelMeasurement>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user