Skip to content

Commit

Permalink
feat(overlay): add inline binary overlays (#3852)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler authored Dec 13, 2023
1 parent c4064ac commit 0177b62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions extensions/cornerstone/src/tools/ImageOverlayViewerTool.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VolumeViewport, metaData, utilities } from '@cornerstonejs/core';
import { IStackViewport, IVolumeViewport, Point3 } from '@cornerstonejs/core/dist/esm/types';
import { AnnotationDisplayTool, drawing } from '@cornerstonejs/tools';
import { guid } from '@ohif/core/src/utils';
import { guid, b64toBlob } from '@ohif/core/src/utils';
import OverlayPlaneModuleProvider from './OverlayPlaneModuleProvider';

interface CachedStat {
Expand Down Expand Up @@ -46,7 +46,7 @@ class ImageOverlayViewerTool extends AnnotationDisplayTool {
super(toolProps, defaultToolProps);
}

onSetToolDisabled = (): void => { };
onSetToolDisabled = (): void => {};

protected getReferencedImageId(viewport: IStackViewport | IVolumeViewport): string {
if (viewport instanceof VolumeViewport) {
Expand Down Expand Up @@ -174,6 +174,10 @@ class ImageOverlayViewerTool extends AnnotationDisplayTool {
pixelData = overlay.pixelData[0];
} else if (overlay.pixelData.retrieveBulkData) {
pixelData = await overlay.pixelData.retrieveBulkData();
} else if (overlay.pixelData.InlineBinary) {
const blob = b64toBlob(overlay.pixelData.InlineBinary);
const arrayBuffer = await blob.arrayBuffer();
pixelData = arrayBuffer;
}

if (!pixelData) {
Expand Down

0 comments on commit 0177b62

Please sign in to comment.