Skip to content

Commit

Permalink
fix(presentation-state): Iterate over map properly to restore the pre…
Browse files Browse the repository at this point in the history
…sentation state (#4013)
  • Loading branch information
IbrahimCSAE authored Apr 3, 2024
1 parent d8f6685 commit fa38e6a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fa38e6a

Please sign in to comment.