larvitar 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/deploy.yml +3 -12
- package/README.md +3 -3
- package/docs/documentation/Mixins.polygonSegmentationMixin%20-%20segmentation%20operations%20for%20polyline.html +171 -0
- package/docs/documentation/Tools.Annotation.ContoursTool.html +218 -0
- package/docs/documentation/Tools.Annotation.DiameterTool.html +219 -0
- package/docs/documentation/Tools.Annotation.SeedsTool.html +214 -0
- package/docs/documentation/Tools.Brush.BrushTool.html +218 -0
- package/docs/documentation/Tools.Brush.ThresholdsBrushTool.html +218 -0
- package/docs/documentation/Tools.PolylineScissorsTool.html +218 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/documentation/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/documentation/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/documentation/global.html +1303 -0
- package/docs/documentation/imageAnonymization.js.html +245 -0
- package/docs/documentation/imageColormaps.js.html +283 -0
- package/docs/documentation/imageContours.js.html +278 -0
- package/docs/documentation/imageIo.js.html +291 -0
- package/docs/documentation/imageLayers.js.html +188 -0
- package/docs/documentation/imageLoading.js.html +297 -0
- package/docs/documentation/imageParsing.js.html +385 -0
- package/docs/documentation/imagePresets.js.html +207 -0
- package/docs/documentation/imageRendering.js.html +849 -0
- package/docs/documentation/imageReslice.js.html +162 -0
- package/docs/documentation/imageStore.js.html +360 -0
- package/docs/documentation/imageTools.js.html +784 -0
- package/docs/documentation/imageUtils.js.html +1609 -0
- package/docs/documentation/image_colormaps.js.html +283 -0
- package/docs/documentation/image_contours.js.html +279 -0
- package/docs/documentation/image_io.js.html +288 -0
- package/docs/documentation/image_layers.js.html +188 -0
- package/docs/documentation/image_loading.js.html +294 -0
- package/docs/documentation/image_parsing.js.html +391 -0
- package/docs/documentation/image_presets.js.html +207 -0
- package/docs/documentation/image_rendering.js.html +845 -0
- package/docs/documentation/image_reslice.js.html +164 -0
- package/docs/documentation/image_store.js.html +359 -0
- package/docs/documentation/image_tools.js.html +792 -0
- package/docs/documentation/image_utils.js.html +1609 -0
- package/docs/documentation/index.html +175 -0
- package/docs/documentation/loaders_commonLoader.js.html +306 -0
- package/docs/documentation/loaders_dicomLoader.js.html +130 -0
- package/docs/documentation/loaders_fileLoader.js.html +155 -0
- package/docs/documentation/loaders_multiframeLoader.js.html +443 -0
- package/docs/documentation/loaders_niftiLoader.js.html +150 -0
- package/docs/documentation/loaders_nrrdLoader.js.html +545 -0
- package/docs/documentation/loaders_resliceLoader.js.html +258 -0
- package/docs/documentation/module-imaging_contours.html +954 -0
- package/docs/documentation/module-imaging_imageAnonymization.html +544 -0
- package/docs/documentation/module-imaging_imageColormaps.html +1012 -0
- package/docs/documentation/module-imaging_imageContours.html +954 -0
- package/docs/documentation/module-imaging_imageIo.html +1057 -0
- package/docs/documentation/module-imaging_imageLayers.html +904 -0
- package/docs/documentation/module-imaging_imageLoading.html +1301 -0
- package/docs/documentation/module-imaging_imageParsing.html +1356 -0
- package/docs/documentation/module-imaging_imagePresets.html +679 -0
- package/docs/documentation/module-imaging_imageRendering.html +3223 -0
- package/docs/documentation/module-imaging_imageReslice.html +413 -0
- package/docs/documentation/module-imaging_imageStore-Larvitar_Store.html +284 -0
- package/docs/documentation/module-imaging_imageStore.html +1560 -0
- package/docs/documentation/module-imaging_imageTools.html +3617 -0
- package/docs/documentation/module-imaging_imageUtils.html +7253 -0
- package/docs/documentation/module-imaging_io.html +1057 -0
- package/docs/documentation/module-imaging_layers.html +904 -0
- package/docs/documentation/module-imaging_loading.html +1301 -0
- package/docs/documentation/module-imaging_parsing.html +1375 -0
- package/docs/documentation/module-imaging_presets.html +679 -0
- package/docs/documentation/module-imaging_rendering.html +8094 -0
- package/docs/documentation/module-imaging_reslice.html +411 -0
- package/docs/documentation/module-imaging_store-Larvitar_Store.html +284 -0
- package/docs/documentation/module-imaging_store.html +1537 -0
- package/docs/documentation/module-imaging_strategies_eraseFreehand.html +708 -0
- package/docs/documentation/module-imaging_strategies_fillFreehand.html +708 -0
- package/docs/documentation/module-imaging_tools.html +3617 -0
- package/docs/documentation/module-imaging_tools_custom_contourTool.html +207 -0
- package/docs/documentation/module-imaging_tools_custom_diameterTool.html +205 -0
- package/docs/documentation/module-imaging_tools_custom_editMaskTool.html +205 -0
- package/docs/documentation/module-imaging_tools_custom_polygonScissorsTool.html +203 -0
- package/docs/documentation/module-imaging_tools_custom_thresholdBrushTool.html +684 -0
- package/docs/documentation/module-imaging_tools_default.html +205 -0
- package/docs/documentation/module-imaging_tools_interaction.html +530 -0
- package/docs/documentation/module-imaging_tools_io.html +832 -0
- package/docs/documentation/module-imaging_tools_main.html +2028 -0
- package/docs/documentation/module-imaging_tools_polygonSegmentationMixin.html +567 -0
- package/docs/documentation/module-imaging_tools_segmentation.html +3586 -0
- package/docs/documentation/module-imaging_tools_state.html +494 -0
- package/docs/documentation/module-imaging_utils.html +7253 -0
- package/docs/documentation/module-loaders_commonLoader.html +1313 -0
- package/docs/documentation/module-loaders_dicomLoader.html +522 -0
- package/docs/documentation/module-loaders_fileLoader.html +593 -0
- package/docs/documentation/module-loaders_multiframeLoader.html +1169 -0
- package/docs/documentation/module-loaders_niftiLoader.html +565 -0
- package/docs/documentation/module-loaders_nrrdLoader.html +1459 -0
- package/docs/documentation/module-loaders_resliceLoader.html +590 -0
- package/docs/documentation/module-monitors_memory.html +980 -0
- package/docs/documentation/module-tools_default.html +740 -0
- package/docs/documentation/module.exports_module.exports.html +203 -0
- package/docs/documentation/monitors_memory.js.html +189 -0
- package/docs/documentation/parsers_nrrd.js.html +569 -0
- package/docs/documentation/scripts/collapse.js +20 -0
- package/docs/documentation/scripts/linenumber.js +25 -0
- package/docs/documentation/scripts/nav.js +12 -0
- package/docs/documentation/scripts/polyfill.js +4 -0
- package/docs/documentation/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/documentation/scripts/prettify/lang-css.js +2 -0
- package/docs/documentation/scripts/prettify/prettify.js +28 -0
- package/docs/documentation/scripts/search.js +83 -0
- package/docs/documentation/styles/jsdoc.css +765 -0
- package/docs/documentation/styles/prettify.css +80 -0
- package/docs/documentation/tools_contourTool.js.html +1963 -0
- package/docs/documentation/tools_custom_contourTool.js.html +1968 -0
- package/docs/documentation/tools_custom_diameterTool.js.html +225 -0
- package/docs/documentation/tools_custom_editMaskTool.js.html +225 -0
- package/docs/documentation/tools_custom_polylineScissorsTool.js.html +143 -0
- package/docs/documentation/tools_custom_thresholdsBrushTool.js.html +245 -0
- package/docs/documentation/tools_default.js.html +576 -0
- package/docs/documentation/tools_diameterTool.js.html +219 -0
- package/docs/documentation/tools_editMaskTool.js.html +219 -0
- package/docs/documentation/tools_interaction.js.html +258 -0
- package/docs/documentation/tools_io.js.html +297 -0
- package/docs/documentation/tools_main.js.html +443 -0
- package/docs/documentation/tools_polygonSegmentationMixin.js.html +329 -0
- package/docs/documentation/tools_polylineScissorsTool.js.html +136 -0
- package/docs/documentation/tools_seedTool.js.html +423 -0
- package/docs/documentation/tools_segmentation.js.html +558 -0
- package/docs/documentation/tools_state.js.html +163 -0
- package/docs/documentation/tools_strategies_eraseFreehand.js.html +160 -0
- package/docs/documentation/tools_strategies_fillFreehand.js.html +163 -0
- package/docs/documentation/tools_thresholdsBrushTool.js.html +239 -0
- package/docs/documentation/tools_tools.default.js.html +569 -0
- package/docs/documentation/tools_tools.interaction.js.html +251 -0
- package/docs/documentation/tools_tools.io.js.html +288 -0
- package/docs/documentation/tools_tools.main.js.html +442 -0
- package/docs/documentation/tools_tools.segmentation.js.html +445 -0
- package/docs/documentation/tools_tools.state.js.html +157 -0
- package/docs/examples/base.html +170 -0
- package/docs/examples/colorMaps.html +181 -0
- package/docs/examples/defaultTools.html +246 -0
- package/docs/examples/demo/anon1 +0 -0
- package/docs/examples/demo/anon10 +0 -0
- package/docs/examples/demo/anon11 +0 -0
- package/docs/examples/demo/anon12 +0 -0
- package/docs/examples/demo/anon13 +0 -0
- package/docs/examples/demo/anon14 +0 -0
- package/docs/examples/demo/anon15 +0 -0
- package/docs/examples/demo/anon16 +0 -0
- package/docs/examples/demo/anon17 +0 -0
- package/docs/examples/demo/anon18 +0 -0
- package/docs/examples/demo/anon19 +0 -0
- package/docs/examples/demo/anon2 +0 -0
- package/docs/examples/demo/anon20 +0 -0
- package/docs/examples/demo/anon21 +0 -0
- package/docs/examples/demo/anon22 +0 -0
- package/docs/examples/demo/anon23 +0 -0
- package/docs/examples/demo/anon24 +0 -0
- package/docs/examples/demo/anon3 +0 -0
- package/docs/examples/demo/anon4 +0 -0
- package/docs/examples/demo/anon5 +0 -0
- package/docs/examples/demo/anon6 +0 -0
- package/docs/examples/demo/anon7 +0 -0
- package/docs/examples/demo/anon8 +0 -0
- package/docs/examples/demo/anon9 +0 -0
- package/docs/examples/demo/example.nrrd +0 -0
- package/docs/examples/demo/segmentation.nrrd +0 -0
- package/docs/examples/demo/xa_integris.dcm +0 -0
- package/docs/examples/index.html +129 -0
- package/docs/examples/larvitar.js +108623 -0
- package/docs/examples/layers.html +250 -0
- package/docs/examples/masks.html +273 -0
- package/docs/examples/multiframe.html +200 -0
- package/docs/examples/nrrd.html +96 -0
- package/docs/examples/reslice.html +174 -0
- package/docs/index.html +92 -0
- package/imaging/tools/segmentation.js +12 -2
- package/imaging/tools/segmentations.md +6 -0
- package/imaging/tools/setLabelMap3D.js +248 -0
- package/package.json +1 -1
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a custom version of setLabelMap3D from cs tools source code
|
|
3
|
+
* This let us implement a non-blocking version of the for loop that loads 3d labelmaps on a volume
|
|
4
|
+
* @ronzim
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// import getElement from "./getElement";
|
|
8
|
+
// import { getToolState } from "../../../stateManagement/toolState.js";
|
|
9
|
+
// import state from "./state";
|
|
10
|
+
// import getSegmentsOnPixelData from "./getSegmentsOnPixeldata";
|
|
11
|
+
// import { triggerLabelmapModifiedEvent } from "../../../util/segmentation";
|
|
12
|
+
// import ARRAY_TYPES from "./arrayTypes";
|
|
13
|
+
// import { getModule } from "../../index.js";
|
|
14
|
+
|
|
15
|
+
const ARRAY_TYPES = {
|
|
16
|
+
UINT_16_ARRAY: 0,
|
|
17
|
+
FLOAT_32_ARRAY: 1
|
|
18
|
+
};
|
|
19
|
+
const { UINT_16_ARRAY, FLOAT_32_ARRAY } = ARRAY_TYPES;
|
|
20
|
+
|
|
21
|
+
import cornerstoneTools from "cornerstone-tools/dist/cornerstoneTools.js";
|
|
22
|
+
const { triggerLabelmapModifiedEvent } = cornerstoneTools.importInternal(
|
|
23
|
+
"util/segmentationUtils"
|
|
24
|
+
);
|
|
25
|
+
const getModule = cornerstoneTools.getModule;
|
|
26
|
+
const getToolState = cornerstoneTools.getToolState;
|
|
27
|
+
const storeGetters = cornerstoneTools.store.getters;
|
|
28
|
+
const state = getModule("segmentation").state;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* These function are reported since they are not exposed by cs tools
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
// from getSegmentsOnPixelData.js
|
|
36
|
+
function getSegmentsOnPixelData(pixelData) {
|
|
37
|
+
return [...new Set(pixelData)];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// from getElement.js
|
|
41
|
+
function getElement(elementOrEnabledElementUID) {
|
|
42
|
+
if (elementOrEnabledElementUID instanceof HTMLElement) {
|
|
43
|
+
return elementOrEnabledElementUID;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return storeGetters.enabledElementByUID(elementOrEnabledElementUID);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Takes a 16-bit encoded `ArrayBuffer` and stores it as a `Labelmap3D` for the
|
|
51
|
+
* `BrushStackState` associated with the element.
|
|
52
|
+
*
|
|
53
|
+
* @param {HTMLElement|string} elementOrEnabledElementUID The cornerstone
|
|
54
|
+
* enabled element or its UUID.
|
|
55
|
+
* @param {ArrayBuffer} buffer
|
|
56
|
+
* @param {number} labelmapIndex The index to store the labelmap under.
|
|
57
|
+
* @param {Object[]} metadata = [] Any metadata about the segments.
|
|
58
|
+
* @param {number[][]} [segmentsOnLabelmapArray] An array of array of segments on each imageIdIndex.
|
|
59
|
+
* If not present, is calculated.
|
|
60
|
+
* @param {colorLUTIndex} [colorLUTIndex = 0] The index of the colorLUT to use to render the segmentation.
|
|
61
|
+
* @returns {null}
|
|
62
|
+
*/
|
|
63
|
+
async function setLabelmap3DForElement(
|
|
64
|
+
elementOrEnabledElementUID,
|
|
65
|
+
buffer,
|
|
66
|
+
labelmapIndex,
|
|
67
|
+
metadata = [],
|
|
68
|
+
segmentsOnLabelmapArray,
|
|
69
|
+
colorLUTIndex = 0
|
|
70
|
+
) {
|
|
71
|
+
const element = getElement(elementOrEnabledElementUID);
|
|
72
|
+
|
|
73
|
+
if (!element) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const stackState = getToolState(element, "stack");
|
|
78
|
+
const numberOfFrames = stackState.data[0].imageIds.length;
|
|
79
|
+
const firstImageId = stackState.data[0].imageIds[0];
|
|
80
|
+
|
|
81
|
+
const res = await setLabelmap3DByFirstImageId(
|
|
82
|
+
firstImageId,
|
|
83
|
+
buffer,
|
|
84
|
+
labelmapIndex,
|
|
85
|
+
metadata,
|
|
86
|
+
numberOfFrames,
|
|
87
|
+
segmentsOnLabelmapArray,
|
|
88
|
+
colorLUTIndex
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
triggerLabelmapModifiedEvent(element, labelmapIndex);
|
|
92
|
+
|
|
93
|
+
return res;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Takes an 16-bit encoded `ArrayBuffer` and stores it as a `Labelmap3D` for
|
|
98
|
+
* the `BrushStackState` associated with the firstImageId.
|
|
99
|
+
*
|
|
100
|
+
* @param {HTMLElement|string} firstImageId The firstImageId of the series to
|
|
101
|
+
* store the segmentation on.
|
|
102
|
+
* @param {ArrayBuffer} buffer
|
|
103
|
+
* @param {number} labelmapIndex The index to store the labelmap under.
|
|
104
|
+
* @param {Object[]} metadata = [] Any metadata about the segments.
|
|
105
|
+
* @param {number} numberOfFrames The number of frames, required to set up the
|
|
106
|
+
* relevant labelmap2D views.
|
|
107
|
+
* @param {number[][]} [segmentsOnLabelmapArray] An array of array of segments on each imageIdIndex.
|
|
108
|
+
* If not present, is calculated.
|
|
109
|
+
* @param {colorLUTIndex} [colorLUTIndex = 0] The index of the colorLUT to use to render the segmentation.
|
|
110
|
+
* @returns {null}
|
|
111
|
+
*/
|
|
112
|
+
function setLabelmap3DByFirstImageId(
|
|
113
|
+
firstImageId,
|
|
114
|
+
buffer,
|
|
115
|
+
labelmapIndex,
|
|
116
|
+
metadata = [],
|
|
117
|
+
numberOfFrames,
|
|
118
|
+
segmentsOnLabelmapArray,
|
|
119
|
+
colorLUTIndex = 0
|
|
120
|
+
) {
|
|
121
|
+
const { configuration } = getModule("segmentation");
|
|
122
|
+
|
|
123
|
+
let brushStackState = state.series[firstImageId];
|
|
124
|
+
|
|
125
|
+
if (!brushStackState) {
|
|
126
|
+
state.series[firstImageId] = {
|
|
127
|
+
activeLabelmapIndex: labelmapIndex,
|
|
128
|
+
labelmaps3D: []
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
brushStackState = state.series[firstImageId];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
brushStackState.labelmaps3D[labelmapIndex] = {
|
|
135
|
+
buffer,
|
|
136
|
+
labelmaps2D: [],
|
|
137
|
+
metadata,
|
|
138
|
+
activeSegmentIndex: 1,
|
|
139
|
+
colorLUTIndex,
|
|
140
|
+
segmentsHidden: [],
|
|
141
|
+
undo: [],
|
|
142
|
+
redo: []
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const labelmaps2D = brushStackState.labelmaps3D[labelmapIndex].labelmaps2D;
|
|
146
|
+
const slicelengthInBytes = buffer.byteLength / numberOfFrames;
|
|
147
|
+
|
|
148
|
+
/* non-blocking implementation by @ronzim */
|
|
149
|
+
|
|
150
|
+
return new Promise(resolve => {
|
|
151
|
+
function setSingleSlice(i, numberOfFrames) {
|
|
152
|
+
var pixelData = void 0;
|
|
153
|
+
|
|
154
|
+
switch (configuration.arrayType) {
|
|
155
|
+
case UINT_16_ARRAY:
|
|
156
|
+
pixelData = new Uint16Array(
|
|
157
|
+
buffer,
|
|
158
|
+
slicelengthInBytes * i, // 2 bytes/voxel
|
|
159
|
+
slicelengthInBytes / 2
|
|
160
|
+
);
|
|
161
|
+
break;
|
|
162
|
+
|
|
163
|
+
case FLOAT_32_ARRAY:
|
|
164
|
+
pixelData = new Float32Array(
|
|
165
|
+
buffer,
|
|
166
|
+
slicelengthInBytes * i,
|
|
167
|
+
slicelengthInBytes / 4
|
|
168
|
+
);
|
|
169
|
+
break;
|
|
170
|
+
|
|
171
|
+
default:
|
|
172
|
+
throw new Error(
|
|
173
|
+
"Unsupported Array Type ".concat(configuration.arrayType)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
var segmentsOnLabelmap = segmentsOnLabelmapArray
|
|
178
|
+
? segmentsOnLabelmapArray[i]
|
|
179
|
+
: getSegmentsOnPixelData(pixelData);
|
|
180
|
+
|
|
181
|
+
if (
|
|
182
|
+
segmentsOnLabelmap &&
|
|
183
|
+
segmentsOnLabelmap.some(function (segment) {
|
|
184
|
+
return segment;
|
|
185
|
+
})
|
|
186
|
+
) {
|
|
187
|
+
labelmaps2D[i] = {
|
|
188
|
+
pixelData: pixelData,
|
|
189
|
+
segmentsOnLabelmap: segmentsOnLabelmap
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
++i;
|
|
194
|
+
|
|
195
|
+
if (i < numberOfFrames) {
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
setSingleSlice(i, numberOfFrames);
|
|
198
|
+
}, 0);
|
|
199
|
+
} else {
|
|
200
|
+
resolve("OK");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
setSingleSlice(0, numberOfFrames);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/* original implementation
|
|
208
|
+
|
|
209
|
+
for (let i = 0; i < numberOfFrames; i++) {
|
|
210
|
+
let pixelData;
|
|
211
|
+
|
|
212
|
+
switch (configuration.arrayType) {
|
|
213
|
+
case UINT_16_ARRAY:
|
|
214
|
+
pixelData = new Uint16Array(
|
|
215
|
+
buffer,
|
|
216
|
+
slicelengthInBytes * i, // 2 bytes/voxel
|
|
217
|
+
slicelengthInBytes / 2
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
break;
|
|
221
|
+
|
|
222
|
+
case FLOAT_32_ARRAY:
|
|
223
|
+
pixelData = new Float32Array(
|
|
224
|
+
buffer,
|
|
225
|
+
slicelengthInBytes * i,
|
|
226
|
+
slicelengthInBytes / 4
|
|
227
|
+
);
|
|
228
|
+
break;
|
|
229
|
+
|
|
230
|
+
default:
|
|
231
|
+
throw new Error(`Unsupported Array Type ${configuration.arrayType}`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const segmentsOnLabelmap = segmentsOnLabelmapArray
|
|
235
|
+
? segmentsOnLabelmapArray[i]
|
|
236
|
+
: getSegmentsOnPixelData(pixelData);
|
|
237
|
+
|
|
238
|
+
if (segmentsOnLabelmap && segmentsOnLabelmap.some(segment => segment)) {
|
|
239
|
+
labelmaps2D[i] = {
|
|
240
|
+
pixelData,
|
|
241
|
+
segmentsOnLabelmap
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
*/
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export { setLabelmap3DByFirstImageId, setLabelmap3DForElement };
|
package/package.json
CHANGED