Skip to content

Commit 0177b62

Browse files
authored
feat(overlay): add inline binary overlays (#3852)
1 parent c4064ac commit 0177b62

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

extensions/cornerstone/src/tools/ImageOverlayViewerTool.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { VolumeViewport, metaData, utilities } from '@cornerstonejs/core';
22
import { IStackViewport, IVolumeViewport, Point3 } from '@cornerstonejs/core/dist/esm/types';
33
import { AnnotationDisplayTool, drawing } from '@cornerstonejs/tools';
4-
import { guid } from '@ohif/core/src/utils';
4+
import { guid, b64toBlob } from '@ohif/core/src/utils';
55
import OverlayPlaneModuleProvider from './OverlayPlaneModuleProvider';
66

77
interface CachedStat {
@@ -46,7 +46,7 @@ class ImageOverlayViewerTool extends AnnotationDisplayTool {
4646
super(toolProps, defaultToolProps);
4747
}
4848

49-
onSetToolDisabled = (): void => { };
49+
onSetToolDisabled = (): void => {};
5050

5151
protected getReferencedImageId(viewport: IStackViewport | IVolumeViewport): string {
5252
if (viewport instanceof VolumeViewport) {
@@ -174,6 +174,10 @@ class ImageOverlayViewerTool extends AnnotationDisplayTool {
174174
pixelData = overlay.pixelData[0];
175175
} else if (overlay.pixelData.retrieveBulkData) {
176176
pixelData = await overlay.pixelData.retrieveBulkData();
177+
} else if (overlay.pixelData.InlineBinary) {
178+
const blob = b64toBlob(overlay.pixelData.InlineBinary);
179+
const arrayBuffer = await blob.arrayBuffer();
180+
pixelData = arrayBuffer;
177181
}
178182

179183
if (!pixelData) {

0 commit comments

Comments
 (0)