fix(SegmentationService): _getSegmentCenter wrongly handling seg center availability (#5396)

This commit is contained in:
Vinícius Alves de Faria Resende 2025-09-19 10:25:32 -03:00 committed by GitHub
parent a7576e07a7
commit 74b82bd934
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -1757,7 +1757,10 @@ class SegmentationService extends PubSubService {
return `${volumeLoaderSchema}:${displaySet.displaySetInstanceUID}`;
}
private _getSegmentCenter(segmentationId, segmentIndex) {
private _getSegmentCenter(
segmentationId: string,
segmentIndex: number
): { image?: csTypes.Point3; world: csTypes.Point3 } | undefined {
const segmentation = this.getSegmentation(segmentationId);
if (!segmentation) {
@ -1768,19 +1771,17 @@ class SegmentationService extends PubSubService {
const { cachedStats } = segments[segmentIndex];
if (!cachedStats || !cachedStats?.center || !cachedStats?.namedStats?.center) {
return;
}
if (cachedStats?.center) {
const { center } = cachedStats;
if (!center) {
return center as { image: csTypes.Point3; world: csTypes.Point3 };
}
if (cachedStats?.namedStats?.center) {
return {
world: cachedStats.namedStats.center.value,
};
}
return center;
}
private _setSegmentLockedStatus(segmentationId: string, segmentIndex: number, isLocked: boolean) {

View File

@ -10,9 +10,14 @@ test.beforeEach(async ({ page }) => {
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 page.waitForTimeout(5000);
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtPreHydration);
await page.getByTestId('yes-hydrate-btn').click();
await page.waitForTimeout(5000);
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtPostHydration);
await page.getByText('Small Sphere').click();
await page.waitForTimeout(5000);
await checkForScreenshot(page, page, screenShotPaths.rtHydration.rtJumpToStructure);
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 84 KiB