Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this a bug ?_getViewportInstances function #4134

Closed
wangning08115 opened this issue May 16, 2024 · 1 comment
Closed

Is this a bug ?_getViewportInstances function #4134

wangning08115 opened this issue May 16, 2024 · 1 comment
Assignees

Comments

@wangning08115
Copy link

wangning08115 commented May 16, 2024

What feature or change would you like to see made?

i think the _getViewportInstances function has bug

Why should we prioritize this feature?

file:
D:\OhifViewerV3\extensions\cornerstone\src\Viewport\Overlays\CustomizableViewportOverlay.tsx

function:

`
function _getViewportInstances(viewportData) {
const imageIds = [];
if (viewportData.viewportType === Enums.ViewportType.STACK) {
imageIds.push(viewportData.data.imageIds[0]);
} else if (viewportData.viewportType === Enums.ViewportType.ORTHOGRAPHIC) {
const volumes = viewportData.data;
volumes.forEach(volume => {
if (!volume?.imageIds || volume.imageIds.length === 0) {
return;
}
imageIds.push(volume.imageIds[0]);
});
}
const instances = [];

imageIds.forEach(imageId => {
const instance = metaData.get('instance', imageId) || {};
instances.push(instance);
});
return instances;
}`

i want to know the line :
imageIds.push(viewportData.data.imageIds[0]);
is this a bug? it Always get the first image use 【imageIds[0])】
i think the _getViewportInstances function is get current Viewport all Instances , not the first image.
so is this a bug?

@sedghi sedghi self-assigned this May 16, 2024
@sedghi
Copy link
Member

sedghi commented May 17, 2024

it is not a bug, if we add all instances you will get all the same study information in here

Image

@sedghi sedghi closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants