fix(presentation-state): Iterate over map properly to restore the presentation state (#4013)

This commit is contained in:
Ibrahim 2024-04-03 08:53:29 -04:00 committed by GitHub
parent d8f66856cc
commit fa38e6a07a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,13 +182,14 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
const { lutPresentation, positionPresentation } = presentations;
if (lutPresentation) {
const { presentation } = lutPresentation;
if (viewport instanceof BaseVolumeViewport) {
Object.entries(presentation).forEach(
([volumeId, properties]: [string, Types.ViewportProperties]) => {
if (viewport instanceof VolumeViewport) {
if (presentation instanceof Map) {
presentation.forEach((properties, volumeId) => {
viewport.setProperties(properties, volumeId);
}
);
});
} else {
viewport.setProperties(presentation);
}
} else {
viewport.setProperties(presentation);
}