Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function internalAddSegmentationRepresentation(
if (segmentKeys.length > 0) {
firstSegmentIndex = segmentKeys.map((k) => Number(k)).sort()[0];
}
setActiveSegmentIndex(segmentationId, firstSegmentIndex);
}
setActiveSegmentIndex(segmentationId, firstSegmentIndex);
}

if (representationInput.type === SegmentationRepresentations.Contour) {
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/tools/AdvancedMagnifyTool.ts
Copy link
Copy Markdown
Collaborator Author

@jbocce jbocce Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file fix an exception being thrown for volume viewports that was occurring at least since commit e1b5bc6 (Feb 28, 2025), but likely has existed longer. However even with these changes the magnify glass still does not behave like it does for stack viewports.

See #2428

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const MAGNIFY_VIEWPORT_INITIAL_RADIUS = 125;
const { Events: csEvents } = Enums;

// TODO: find a better to identify segmentation actors
const isSegmentation = (actor) => actor.uid !== actor.referencedId;
const isSegmentation = (actor) => !!actor.representationUID;

export type AutoPanCallbackData = {
points: {
Expand Down Expand Up @@ -1355,7 +1355,7 @@ class AdvancedMagnifyViewport {
const actors = sourceViewport.getActors();
const volumeInputArray: Types.IVolumeInput[] = actors
.filter((actor) => !isSegmentation(actor))
.map((actor) => ({ volumeId: actor.uid }));
.map((actor) => ({ volumeId: actor.referencedId }));

magnifyViewport.setVolumes(volumeInputArray).then(() => {
this._isViewportReady = true;
Expand Down
Loading