fix(segmentation): Display "No description S:{series number} {modality}" for segmentations with no label. (#5874)
* Bump CS3D dependency to get the fallbackLabel field additions.
This commit is contained in:
1 parent
15f14e34e4
commit
7b5d0ce40e
23 files changed
+349
-228
No files matched your search
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.18.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/adapters": "4.19.0",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@kitware/vtk.js": "34.15.1"
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.18.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/adapters": "4.19.0",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@kitware/vtk.js": "34.15.1"
|
||||
}
|
||||
}
|
||||
@@ -46,9 +46,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.18.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/tools": "4.18.2",
|
||||
"@cornerstonejs/adapters": "4.19.0",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@cornerstonejs/tools": "4.19.0",
|
||||
"classnames": "2.5.1"
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/tools": "4.18.2",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@cornerstonejs/tools": "4.19.0",
|
||||
"classnames": "2.5.1"
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/dicom-image-loader": "4.18.2",
|
||||
"@cornerstonejs/dicom-image-loader": "4.19.0",
|
||||
"@ohif/core": "3.13.0-beta.37",
|
||||
"@ohif/ui": "3.13.0-beta.37",
|
||||
"dcmjs": "0.49.4",
|
||||
@@ -53,12 +53,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.18.2",
|
||||
"@cornerstonejs/ai": "4.18.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/labelmap-interpolation": "4.18.2",
|
||||
"@cornerstonejs/polymorphic-segmentation": "4.18.2",
|
||||
"@cornerstonejs/tools": "4.18.2",
|
||||
"@cornerstonejs/adapters": "4.19.0",
|
||||
"@cornerstonejs/ai": "4.19.0",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@cornerstonejs/labelmap-interpolation": "4.19.0",
|
||||
"@cornerstonejs/polymorphic-segmentation": "4.19.0",
|
||||
"@cornerstonejs/tools": "4.19.0",
|
||||
"@icr/polyseg-wasm": "0.4.0",
|
||||
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
|
||||
"@kitware/vtk.js": "34.15.1",
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useSystem } from '@ohif/core';
|
||||
const excludedModalities = ['SM', 'OT', 'DOC', 'ECG'];
|
||||
|
||||
function mapSegmentationToDisplay(segmentation, customizationService) {
|
||||
const { label, segments } = segmentation;
|
||||
const { label, segments, fallbackLabel } = segmentation;
|
||||
|
||||
// Get the readable text mapping once
|
||||
const readableTextMap = customizationService.getCustomization('panelSegmentation.readableText');
|
||||
@@ -76,6 +76,7 @@ function mapSegmentationToDisplay(segmentation, customizationService) {
|
||||
return {
|
||||
...segmentation,
|
||||
label,
|
||||
fallbackLabel,
|
||||
segments: updatedSegments,
|
||||
};
|
||||
}
|
||||
|
||||
+10
-1
@@ -1120,6 +1120,7 @@ describe('SegmentationService', () => {
|
||||
isDynamicVolume: false,
|
||||
SeriesNumber: 1,
|
||||
SeriesDescription: 'Series Description',
|
||||
Modality: 'SEG',
|
||||
} as unknown as AppTypes.DisplaySet;
|
||||
|
||||
jest
|
||||
@@ -1145,6 +1146,7 @@ describe('SegmentationService', () => {
|
||||
info: 'S1: Series Description',
|
||||
},
|
||||
label: 'Segmentation 2',
|
||||
fallbackLabel: 'S:1 SEG',
|
||||
segments: {
|
||||
'1': {
|
||||
active: true,
|
||||
@@ -1175,6 +1177,7 @@ describe('SegmentationService', () => {
|
||||
dynamicVolumeInfo: {
|
||||
timePoints: ['timePoint1', 'timePoint2', 'timePoint3'],
|
||||
},
|
||||
Modality: 'SEG',
|
||||
} as unknown as AppTypes.DisplaySet;
|
||||
|
||||
jest
|
||||
@@ -1212,6 +1215,7 @@ describe('SegmentationService', () => {
|
||||
info: 'S1: Series Description',
|
||||
},
|
||||
label: 'Segmentation 2',
|
||||
fallbackLabel: 'S:1 SEG',
|
||||
segments: {
|
||||
'1': {
|
||||
active: true,
|
||||
@@ -1320,6 +1324,8 @@ describe('SegmentationService', () => {
|
||||
},
|
||||
SeriesDate: '2025-01-01',
|
||||
SeriesDescription: 'Series Description',
|
||||
Modality: 'SEG',
|
||||
SeriesNumber: 1,
|
||||
};
|
||||
|
||||
const referencedDisplaySet = {
|
||||
@@ -1379,6 +1385,7 @@ describe('SegmentationService', () => {
|
||||
const expectedSegmentation = {
|
||||
config: {
|
||||
label: segDisplaySet.SeriesDescription,
|
||||
fallbackLabel: 'S:1 SEG',
|
||||
segments: {
|
||||
'1': {
|
||||
active: false,
|
||||
@@ -1534,7 +1541,7 @@ describe('SegmentationService', () => {
|
||||
it('should create a segmentation for a RTSTRUCT display set', async () => {
|
||||
const segmentationId = 'segmentationId';
|
||||
const rtStructDisplaySet = {
|
||||
modality: 'RTSTRUCT',
|
||||
Modality: 'RTSTRUCT',
|
||||
displaySetInstanceUID: 'display-set-uid',
|
||||
referencedDisplaySetInstanceUID: 'existent-display-set-uid',
|
||||
SeriesDate: '2025-01-01',
|
||||
@@ -1544,6 +1551,7 @@ describe('SegmentationService', () => {
|
||||
ROIContours: [{}, {}, {}],
|
||||
frameOfReferenceUID: 'frameOfReferenceUID',
|
||||
},
|
||||
SeriesNumber: 1,
|
||||
};
|
||||
|
||||
const referencedDisplaySet = {
|
||||
@@ -1650,6 +1658,7 @@ describe('SegmentationService', () => {
|
||||
const expectedSegmentation = {
|
||||
config: {
|
||||
label: rtStructDisplaySet.SeriesDescription,
|
||||
fallbackLabel: 'S:1 RTSTRUCT',
|
||||
segments: {
|
||||
'1': {
|
||||
active: false,
|
||||
|
||||
@@ -55,6 +55,7 @@ export type SegmentationRepresentation = cstTypes.SegmentationRepresentation & {
|
||||
viewportId: string;
|
||||
id: string;
|
||||
label: string;
|
||||
fallbackLabel?: string;
|
||||
styles: cstTypes.RepresentationStyle;
|
||||
segments: {
|
||||
[key: number]: SegmentRepresentation;
|
||||
@@ -430,6 +431,7 @@ class SegmentationService extends PubSubService {
|
||||
},
|
||||
config: {
|
||||
label,
|
||||
fallbackLabel: `S:${displaySet.SeriesNumber} ${displaySet.Modality}`,
|
||||
segments:
|
||||
options?.segments && Object.keys(options.segments).length > 0
|
||||
? options.segments
|
||||
@@ -583,6 +585,7 @@ class SegmentationService extends PubSubService {
|
||||
},
|
||||
config: {
|
||||
label: segDisplaySet.SeriesDescription,
|
||||
fallbackLabel: `S:${segDisplaySet.SeriesNumber} ${segDisplaySet.Modality}`,
|
||||
segments,
|
||||
},
|
||||
};
|
||||
@@ -664,6 +667,7 @@ class SegmentationService extends PubSubService {
|
||||
},
|
||||
config: {
|
||||
label: rtDisplaySet.SeriesDescription,
|
||||
fallbackLabel: `S:${rtDisplaySet.SeriesNumber} ${rtDisplaySet.Modality}`,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1842,6 +1846,7 @@ class SegmentationService extends PubSubService {
|
||||
id: id,
|
||||
segmentationId,
|
||||
label: segmentation.label,
|
||||
fallbackLabel: segmentation.fallbackLabel,
|
||||
active,
|
||||
type,
|
||||
visible,
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
"start": "yarn run dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/tools": "4.18.2",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@cornerstonejs/tools": "4.19.0",
|
||||
"@ohif/core": "3.13.0-beta.37",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "3.13.0-beta.37",
|
||||
"@ohif/extension-default": "3.13.0-beta.37",
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/core": "4.18.2",
|
||||
"@cornerstonejs/tools": "4.18.2",
|
||||
"@cornerstonejs/core": "4.19.0",
|
||||
"@cornerstonejs/tools": "4.19.0",
|
||||
"@ohif/core": "3.13.0-beta.37",
|
||||
"@ohif/extension-cornerstone": "3.13.0-beta.37",
|
||||
"@ohif/extension-default": "3.13.0-beta.37",
|
||||
|
||||
Reference in new issue
Block a user