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:
Joe Boccanfuso authored and GitHub committed 2026-03-12 18:39:14 -04:00
1 parent 15f14e34e4
commit 7b5d0ce40e
23 files changed
+349 -228

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import { expect, test, visitStudy } from './utils';
test('checks that segmentations created from series with no series description are labelled as "No description S:{series number} {modality}"', async ({
rightPanelPageObject,
leftPanelPageObject,
DOMOverlayPageObject,
page,
}) => {
const studyInstanceUID = '1.3.6.1.4.1.32722.99.99.62087908186665265759322018723889952421';
const mode = 'segmentation'; // To also test add/remove
await visitStudy(page, studyInstanceUID, mode, 2000);
const segmentationPanel = rightPanelPageObject.contourSegmentationPanel.menuButton;
// Switch to contour tab.
await segmentationPanel.click();
await leftPanelPageObject.loadSeriesByModality('RTSTRUCT');
await page.waitForTimeout(5000);
await DOMOverlayPageObject.viewport.segmentationHydration.yes.click();
expect(rightPanelPageObject.contourSegmentationPanel.segmentationSelect.selectedValue).toHaveText(
'No description S:4 RTSTRUCT'
);
expect(
await rightPanelPageObject.contourSegmentationPanel.segmentationSelect.nthSegmentation(0)
).toHaveText('No description S:4 RTSTRUCT');
});
+29
View File
@@ -126,6 +126,31 @@ export class RightPanelPageObject {
};
}
private getSegmentationSelect(type: string) {
const page = this.page;
const suffix = type ? `-${type}` : '';
const locator = page.getByTestId(`segmentation-select${suffix}`);
const selectedValue = page.getByTestId(`segmentation-select-value${suffix}`);
const nthSegmentation = async (n: number) => {
await locator.click();
return page.getByRole('option').nth(n);
};
return {
/** The SelectTrigger button element */
locator,
/** The span showing the currently selected segmentation label */
selectedValue,
/** Opens the dropdown and returns a locator for the nth option (0-based) */
nthSegmentation,
/** Opens the dropdown and clicks the nth segmentation (0-based) */
selectNthSegmentation: async (n: number) => {
await (await nthSegmentation(n)).click();
},
};
}
private get addSegmentationButton() {
const button = this.page.getByTestId('addSegmentation');
return {
@@ -163,11 +188,13 @@ export class RightPanelPageObject {
const addSegmentationButton = this.addSegmentationButton;
const panel = this.getSegmentationPanel('Contour');
const menuButton = page.getByTestId('panelSegmentationWithToolsContour-btn');
const segmentationSelect = this.getSegmentationSelect('Contour');
return {
addSegmentationButton,
menuButton,
panel,
segmentationSelect,
select: async () => {
await menuButton.click();
},
@@ -178,11 +205,13 @@ export class RightPanelPageObject {
const addSegmentationButton = this.addSegmentationButton;
const panel = this.getSegmentationPanel('Labelmap');
const menuButton = page.getByTestId('panelSegmentationWithToolsLabelMap-btn');
const segmentationSelect = this.getSegmentationSelect('Labelmap');
return {
addSegmentationButton,
menuButton,
panel,
segmentationSelect,
select: async () => {
await menuButton.click();
},