test(hyrdation): weekly tests PR (#4263)
@ -46,11 +46,13 @@ function _askHydrate(uiViewportDialogService: AppTypes.UIViewportDialogService,
|
||||
const message = 'Do you want to open this Segmentation?';
|
||||
const actions = [
|
||||
{
|
||||
id: 'no-hydrate',
|
||||
type: ButtonEnums.type.secondary,
|
||||
text: 'No',
|
||||
value: RESPONSE.CANCEL,
|
||||
},
|
||||
{
|
||||
id: 'yes-hydrate',
|
||||
type: ButtonEnums.type.primary,
|
||||
text: 'Yes',
|
||||
value: RESPONSE.HYDRATE_SEG,
|
||||
|
||||
@ -44,11 +44,13 @@ function _askHydrate(uiViewportDialogService, viewportId) {
|
||||
const message = 'Do you want to open this Segmentation?';
|
||||
const actions = [
|
||||
{
|
||||
id: 'no-hydrate',
|
||||
type: ButtonEnums.type.secondary,
|
||||
text: 'No',
|
||||
value: RESPONSE.CANCEL,
|
||||
},
|
||||
{
|
||||
id: 'yes-hydrate',
|
||||
type: ButtonEnums.type.primary,
|
||||
text: 'Yes',
|
||||
value: RESPONSE.HYDRATE_SEG,
|
||||
|
||||
@ -7,6 +7,7 @@ const frameView: Types.HangingProtocol.Protocol = {
|
||||
icon: 'tool-stack-scroll',
|
||||
isPreset: true,
|
||||
toolGroupIds: ['default'],
|
||||
protocolMatchingRules: [],
|
||||
displaySetSelectors: {
|
||||
defaultDisplaySetId: {
|
||||
seriesMatchingRules: [
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
getEnabledElementByIds,
|
||||
utilities as csUtils,
|
||||
volumeLoader,
|
||||
StackViewport,
|
||||
} from '@cornerstonejs/core';
|
||||
import {
|
||||
Enums as csToolsEnums,
|
||||
@ -770,8 +771,8 @@ class SegmentationService extends PubSubService {
|
||||
const segmentIndices = segmentIndex
|
||||
? [segmentIndex]
|
||||
: segmentation.segments
|
||||
.filter(segment => segment?.segmentIndex)
|
||||
.map(segment => segment.segmentIndex);
|
||||
.filter(segment => segment?.segmentIndex)
|
||||
.map(segment => segment.segmentIndex);
|
||||
|
||||
const segmentIndicesSet = new Set(segmentIndices);
|
||||
|
||||
@ -884,7 +885,13 @@ class SegmentationService extends PubSubService {
|
||||
// @ts-ignore
|
||||
for (const { viewportId, renderingEngineId } of viewportsInfo) {
|
||||
const { viewport } = getEnabledElementByIds(viewportId, renderingEngineId);
|
||||
cstUtils.viewport.jumpToWorld(viewport, world);
|
||||
if (viewport instanceof StackViewport) {
|
||||
const { element } = viewport;
|
||||
const index = csUtils.getClosestStackImageIndexForPoint(world, viewport)
|
||||
cstUtils.viewport.jumpToSlice(element, { imageIndex: index })
|
||||
} else {
|
||||
cstUtils.viewport.jumpToWorld(viewport, world);
|
||||
}
|
||||
}
|
||||
|
||||
if (highlightSegment) {
|
||||
@ -1250,6 +1257,7 @@ class SegmentationService extends PubSubService {
|
||||
{
|
||||
[segmentIndex]: {
|
||||
CONTOUR: {
|
||||
outlineOpacity: reversedProgress,
|
||||
fillAlpha: reversedProgress,
|
||||
},
|
||||
},
|
||||
|
||||
@ -50,11 +50,13 @@ function _askTrackMeasurements(uiViewportDialogService, viewportId) {
|
||||
const message = 'Do you want to continue tracking measurements for this study?';
|
||||
const actions = [
|
||||
{
|
||||
id: 'no-hydrate',
|
||||
type: ButtonEnums.type.secondary,
|
||||
text: 'No',
|
||||
value: RESPONSE.CANCEL,
|
||||
},
|
||||
{
|
||||
id: 'yes-hydrate',
|
||||
type: ButtonEnums.type.primary,
|
||||
text: 'Yes',
|
||||
value: RESPONSE.HYDRATE_REPORT,
|
||||
|
||||
18
tests/RTHydration.spec.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
const studyInstanceUID = '1.2.840.113619.2.290.3.3767434740.226.1600859119.501';
|
||||
const mode = 'Basic Viewer';
|
||||
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||
});
|
||||
|
||||
test('should hydrate RT reports correctly', async ({ page }) => {
|
||||
await page.getByTestId('side-panel-header-right').click();
|
||||
await page.getByTestId('study-browser-thumbnail-no-image').dblclick();
|
||||
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtPreHydration);
|
||||
await page.getByTestId('yes-hydrate-btn').click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtPostHydration);
|
||||
await page.getByText('Small Sphere').click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtJumpToStructure);
|
||||
});
|
||||
18
tests/SEGHydration.spec.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.256467663913010332776401703474716742458';
|
||||
const mode = 'Basic Viewer';
|
||||
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||
});
|
||||
|
||||
test('should hydrate SEG reports correctly', async ({ page }) => {
|
||||
await page.getByTestId('side-panel-header-right').click();
|
||||
await page.getByTestId('study-browser-thumbnail-no-image').dblclick();
|
||||
await checkForScreenshot(page, page, screenShotPaths.segHydration.segPreHydration);
|
||||
await page.getByTestId('yes-hydrate-btn').click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.segHydration.segPostHydration);
|
||||
await page.getByText('Esophagus').click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.segHydration.segJumpToSegment);
|
||||
});
|
||||
19
tests/SRHydration.spec.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
const studyInstanceUID = '1.3.6.1.4.1.14519.5.2.1.7695.4007.324475281161490036195179843543';
|
||||
const mode = 'Basic Viewer';
|
||||
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||
});
|
||||
|
||||
test('should hydrate SR reports correctly', async ({ page }) => {
|
||||
await page.getByTestId('side-panel-header-right').click();
|
||||
await page.getByTestId('trackedMeasurements-btn').click();
|
||||
await page.getByTestId('study-browser-thumbnail-no-image').dblclick();
|
||||
await checkForScreenshot(page, page, screenShotPaths.srHydration.srPreHydration);
|
||||
await page.getByTestId('yes-hydrate-btn').click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.srHydration.srPostHydration);
|
||||
await page.getByTestId('measurement-item').first().click();
|
||||
await checkForScreenshot(page, page, screenShotPaths.srHydration.srJumpToMeasurement);
|
||||
});
|
||||
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 244 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 235 KiB |
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 222 KiB |
@ -65,6 +65,21 @@ const screenShotPaths = {
|
||||
reset: {
|
||||
resetDisplayedCorrectly: 'resetDisplayedCorrectly.png',
|
||||
},
|
||||
srHydration: {
|
||||
srPostHydration: 'srPostHydration.png',
|
||||
srPreHydration: 'srPreHydration.png',
|
||||
srJumpToMeasurement: 'srJumpToMeasurement.png',
|
||||
},
|
||||
segHydration: {
|
||||
segPostHydration: 'segPostHydration.png',
|
||||
segPreHydration: 'segPreHydration.png',
|
||||
segJumpToSegment: 'segJumpToSegment.png',
|
||||
},
|
||||
rtHydration: {
|
||||
rtPostHydration: 'rtPostHydration.png',
|
||||
rtPreHydration: 'rtPreHydration.png',
|
||||
rtJumpToStructure: 'rtJumpToStructure.png',
|
||||
}
|
||||
};
|
||||
|
||||
export { screenShotPaths };
|
||||
|
||||