Skip to content

Commit

Permalink
send volumeId for volume viewports
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE authored Feb 15, 2024
1 parent d3576b0 commit 103dffa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ type ColormapModifiedEvent = CustomEvent_2<ColormapModifiedEventDetail>;
type ColormapModifiedEventDetail = {
viewportId: string;
colormap: ColormapPublic;
volumeId?: string;
};

// @public (undocumented)
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/RenderingEngine/BaseVolumeViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
if (!suppressEvents) {
const eventDetail = {
viewportId: this.id,
colormap
colormap,
volumeId
};
triggerEvent(this.element, Events.COLORMAP_MODIFIED, eventDetail);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/types/EventTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type ColormapModifiedEventDetail = {
viewportId: string;
/** The new colormap */
colormap: ColormapPublic;
/** Unique ID for the volume in the cache */
volumeId?: string;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/utilities/voi/colorbar/ViewportColorbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ class ViewportColorbar extends Colorbar {
private _viewportColormapModifiedCallback = (
evt: Types.EventTypes.ColormapModifiedEvent
) => {
const { viewportId, colormap } = evt.detail;
const { viewportId, colormap, volumeId } = evt.detail;
const { viewport } = this.enabledElement;

if (viewportId !== viewport.id) {
if (viewportId !== viewport.id || volumeId !== this._volumeId) {
return;
}

Expand Down

0 comments on commit 103dffa

Please sign in to comment.