fix(SegmentationService): _getSegmentCenter wrongly handling seg center availability (#5396)
This commit is contained in:
parent
a7576e07a7
commit
74b82bd934
@ -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;
|
||||
|
||||
return center as { image: csTypes.Point3; world: csTypes.Point3 };
|
||||
}
|
||||
|
||||
const { center } = cachedStats;
|
||||
|
||||
if (!center) {
|
||||
if (cachedStats?.namedStats?.center) {
|
||||
return {
|
||||
world: cachedStats.namedStats.center.value,
|
||||
};
|
||||
}
|
||||
|
||||
return center;
|
||||
}
|
||||
|
||||
private _setSegmentLockedStatus(segmentationId: string, segmentIndex: number, isLocked: boolean) {
|
||||
|
||||
@ -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 |
Loading…
Reference in New Issue
Block a user