Skip to content

Commit 623ca1b

Browse files
Add changes for POC (#237)
1 parent 651b50e commit 623ca1b

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dicom-microscopy-viewer",
3-
"version": "0.48.20",
3+
"version": "0.48.21",
44
"license": "MIT",
55
"author": "ImagingDataCommons",
66
"homepage": "https://github.com/imagingdatacommons/dicom-microscopy-viewer#readme",

src/annotation.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,4 +915,9 @@ export {
915915
_getCoordinateDimensionality,
916916
_getPoint,
917917
_getCoordinates,
918+
/** Stable public alias for non–OpenLayers consumers (e.g. Slim Viv / Deck.gl). */
919+
_fetchGraphicData as fetchGraphicData,
920+
_fetchGraphicIndex as fetchGraphicIndex,
921+
_getCommonZCoordinate as getCommonZCoordinate,
922+
_getCoordinateDimensionality as getCoordinateDimensionality,
918923
}

src/dicom-microscopy-viewer.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
import { AnnotationGroup } from './annotation.js'
1+
import {
2+
AnnotationGroup,
3+
fetchGraphicData,
4+
fetchGraphicIndex,
5+
getCommonZCoordinate,
6+
getCoordinateDimensionality,
7+
} from './annotation.js'
8+
import {
9+
getCircleFeature,
10+
getEllipseFeature,
11+
getFeaturesFromBulkAnnotations,
12+
getPointFeature,
13+
getPolygonFeature,
14+
getRectangleFeature,
15+
getViewportBoundingBox,
16+
isCoordinateInsideBoundingBox,
17+
} from './bulkAnnotations/utils.js'
218
import {
319
buildPaletteColorLookupTable,
420
ColormapNames,
@@ -45,12 +61,34 @@ import {
4561

4662
/**
4763
* Namespace for annotations of DICOM Micrsocopy Bulk Simple Annotations
48-
* instances.
64+
* instances. Exposes fetch/coordinate helpers for Deck.gl without using
65+
* {@link viewer.VolumeImageViewer#addAnnotationGroups}.
4966
*
5067
* @namespace annotation
5168
*/
5269
const annotation = {
5370
AnnotationGroup,
71+
fetchGraphicData,
72+
fetchGraphicIndex,
73+
getCommonZCoordinate,
74+
getCoordinateDimensionality,
75+
}
76+
77+
/**
78+
* Bulk Simple Annotation geometry (OpenLayers features). Same code as
79+
* {@link viewer.VolumeImageViewer#addAnnotationGroups}.
80+
*
81+
* @namespace bulkSimpleAnnotations
82+
*/
83+
const bulkSimpleAnnotations = {
84+
getFeaturesFromBulkAnnotations,
85+
getPointFeature,
86+
getPolygonFeature,
87+
getCircleFeature,
88+
getEllipseFeature,
89+
getRectangleFeature,
90+
getViewportBoundingBox,
91+
isCoordinateInsideBoundingBox,
5492
}
5593

5694
/**
@@ -179,6 +217,7 @@ const utils = {
179217
export {
180218
annotation,
181219
api,
220+
bulkSimpleAnnotations,
182221
color,
183222
events,
184223
mapping,

0 commit comments

Comments
 (0)