larvitar 0.18.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/MIGRATION.md +25 -0
- package/README.md +28 -27
- 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/dataDictionary.json +21865 -21865
- package/imaging/imageAnonymization.js +161 -0
- package/imaging/{image_colormaps.js → imageColormaps.js} +2 -2
- package/imaging/{image_contours.js → imageContours.js} +1 -2
- package/imaging/{image_io.js → imageIo.js} +18 -15
- package/imaging/{image_layers.js → imageLayers.js} +2 -2
- package/imaging/{image_loading.js → imageLoading.js} +9 -6
- package/imaging/imageParsing.js +301 -0
- package/imaging/{image_presets.js → imagePresets.js} +2 -2
- package/imaging/{image_rendering.js → imageRendering.js} +36 -32
- package/imaging/imageReslice.js +78 -0
- package/imaging/{image_store.js → imageStore.js} +8 -7
- package/imaging/{image_tools.js → imageTools.js} +15 -23
- package/imaging/{image_utils.js → imageUtils.js} +1 -1
- package/imaging/loaders/commonLoader.js +1 -1
- package/imaging/loaders/dicomLoader.js +1 -1
- package/imaging/loaders/fileLoader.js +2 -2
- package/imaging/loaders/multiframeLoader.js +6 -2
- package/imaging/loaders/nrrdLoader.js +11 -7
- package/imaging/tools/{contourTool.js → custom/contourTool.js} +25 -20
- package/imaging/tools/{diameterTool.js → custom/diameterTool.js} +9 -3
- package/imaging/tools/{editMaskTool.js → custom/editMaskTool.js} +7 -1
- package/imaging/tools/{polylineScissorsTool.js → custom/polylineScissorsTool.js} +12 -5
- package/imaging/tools/{seedTool.js → custom/seedTool.js} +3 -3
- package/imaging/tools/{thresholdsBrushTool.js → custom/thresholdsBrushTool.js} +7 -1
- package/imaging/tools/{tools.default.js → default.js} +10 -3
- package/imaging/tools/{tools.interaction.js → interaction.js} +13 -6
- package/imaging/tools/{tools.io.js → io.js} +15 -6
- package/imaging/tools/{tools.main.js → main.js} +16 -14
- package/imaging/tools/polygonSegmentationMixin.js +8 -4
- package/imaging/tools/{tools.segmentation.js → segmentation.js} +171 -58
- package/imaging/tools/segmentations.md +38 -0
- package/imaging/tools/setLabelMap3D.js +248 -0
- package/imaging/tools/{tools.state.js → state.js} +7 -1
- package/imaging/tools/strategies/eraseFreehand.js +8 -9
- package/imaging/tools/strategies/fillFreehand.js +8 -9
- package/index.js +44 -39
- package/modules/vuex/larvitar.js +13 -3
- package/package.json +13 -10
- package/imaging/image_parsing.js +0 -307
- package/imaging/image_reslice.js +0 -80
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @module imaging/
|
|
1
|
+
/** @module imaging/imageRendering
|
|
2
2
|
* @desc This file provides functionalities for
|
|
3
3
|
* rendering images in html canvas using cornerstone
|
|
4
4
|
*/
|
|
@@ -10,16 +10,16 @@ import { each, has } from "lodash";
|
|
|
10
10
|
|
|
11
11
|
// internal libraries
|
|
12
12
|
import { getFileImageId } from "./loaders/fileLoader";
|
|
13
|
-
import { csToolsCreateStack } from "./tools/
|
|
14
|
-
import { toggleMouseToolsListeners } from "./tools/
|
|
15
|
-
import { larvitar_store } from "./
|
|
16
|
-
import { applyColorMap } from "./
|
|
17
|
-
import { isElement } from "./
|
|
13
|
+
import { csToolsCreateStack } from "./tools/main";
|
|
14
|
+
import { toggleMouseToolsListeners } from "./tools/interaction";
|
|
15
|
+
import { larvitar_store } from "./imageStore";
|
|
16
|
+
import { applyColorMap } from "./imageColormaps";
|
|
17
|
+
import { isElement } from "./imageUtils";
|
|
18
18
|
|
|
19
19
|
/*
|
|
20
20
|
* This module provides the following functions to be exported:
|
|
21
21
|
* clearImageCache(seriesId)
|
|
22
|
-
* loadAndCacheImages(seriesData
|
|
22
|
+
* loadAndCacheImages(seriesData)
|
|
23
23
|
* renderFileImage(file, elementId)
|
|
24
24
|
* renderWebImage(url, elementId)
|
|
25
25
|
* disableViewport(elementId)
|
|
@@ -121,9 +121,9 @@ export function loadAndCacheImages(series, callback) {
|
|
|
121
121
|
* @function renderWebImage
|
|
122
122
|
* @param {Object} file - The image File object
|
|
123
123
|
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
124
|
-
* @
|
|
124
|
+
* @returns {Promise} - Return a promise which will resolve when image is displayed
|
|
125
125
|
*/
|
|
126
|
-
export const renderFileImage = function (file, elementId
|
|
126
|
+
export const renderFileImage = function (file, elementId) {
|
|
127
127
|
let element = isElement(elementId)
|
|
128
128
|
? elementId
|
|
129
129
|
: document.getElementById(elementId);
|
|
@@ -136,23 +136,23 @@ export const renderFileImage = function (file, elementId, callback) {
|
|
|
136
136
|
cornerstone.enable(element);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
cornerstone.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
139
|
+
let renderPromise = new Promise(resolve => {
|
|
140
|
+
// check if imageId is already stored in fileManager
|
|
141
|
+
const imageId = getFileImageId(file);
|
|
142
|
+
if (imageId) {
|
|
143
|
+
cornerstone.loadImage(imageId).then(function (image) {
|
|
144
|
+
cornerstone.displayImage(element, image);
|
|
145
|
+
let viewport = cornerstone.getViewport(element);
|
|
146
|
+
viewport.displayedArea.brhc.x = image.width;
|
|
147
|
+
viewport.displayedArea.brhc.y = image.height;
|
|
148
|
+
cornerstone.setViewport(element, viewport);
|
|
149
|
+
cornerstone.fitToWindow(element);
|
|
150
|
+
csToolsCreateStack(element);
|
|
151
|
+
resolve(image);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
return renderPromise;
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
/**
|
|
@@ -161,6 +161,7 @@ export const renderFileImage = function (file, elementId, callback) {
|
|
|
161
161
|
* @function renderWebImage
|
|
162
162
|
* @param {String} url - The image data url
|
|
163
163
|
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
164
|
+
* @returns {Promise} - Return a promise which will resolve when image is displayed
|
|
164
165
|
*/
|
|
165
166
|
export const renderWebImage = function (url, elementId) {
|
|
166
167
|
let element = isElement(elementId)
|
|
@@ -170,12 +171,15 @@ export const renderWebImage = function (url, elementId) {
|
|
|
170
171
|
console.error("invalid html element: " + elementId);
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
let renderPromise = new Promise(resolve => {
|
|
175
|
+
cornerstone.enable(element);
|
|
176
|
+
cornerstone.loadImage(url).then(function (image) {
|
|
177
|
+
cornerstone.displayImage(element, image);
|
|
178
|
+
csToolsCreateStack(element);
|
|
179
|
+
resolve(image);
|
|
180
|
+
});
|
|
178
181
|
});
|
|
182
|
+
return renderPromise;
|
|
179
183
|
};
|
|
180
184
|
|
|
181
185
|
/**
|
|
@@ -245,7 +249,7 @@ export const resizeViewport = function (elementId) {
|
|
|
245
249
|
* @param {Object} seriesStack - The original series data object
|
|
246
250
|
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
247
251
|
* @param {Object} defaultProps - Optional default props
|
|
248
|
-
* @return {Promise} Return a promise
|
|
252
|
+
* @return {Promise} Return a promise which will resolve when image is displayed
|
|
249
253
|
*/
|
|
250
254
|
export const renderImage = function (seriesStack, elementId, defaultProps) {
|
|
251
255
|
let t0 = performance.now();
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** @module imaging/imageReslice
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* image reslice in orthogonal directions
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// external libraries
|
|
7
|
+
import { v4 as uuidv4 } from "uuid";
|
|
8
|
+
import { each } from "lodash";
|
|
9
|
+
|
|
10
|
+
// internal libraries
|
|
11
|
+
import { getReslicedMetadata, getReslicedPixeldata } from "./imageUtils";
|
|
12
|
+
import {
|
|
13
|
+
getLarvitarImageTracker,
|
|
14
|
+
getLarvitarManager
|
|
15
|
+
} from "./loaders/commonLoader";
|
|
16
|
+
import { larvitar_store } from "./imageStore";
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* This module provides the following functions to be exported:
|
|
20
|
+
* resliceSeries(seriesId, seriesData, orientation)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Reslice a serie from native orientation to coronal or sagittal orientation
|
|
25
|
+
* @instance
|
|
26
|
+
* @function resliceSeries
|
|
27
|
+
* @param {Object} seriesData the original series data
|
|
28
|
+
* @param {String} orientation the reslice orientation [coronal or sagittal]
|
|
29
|
+
* @param {String} seriesId the series id
|
|
30
|
+
* @returns {Promise} - Return a promise which will resolve when data is available
|
|
31
|
+
*/
|
|
32
|
+
export function resliceSeries(seriesData, orientation) {
|
|
33
|
+
let reslicePromise = new Promise(resolve => {
|
|
34
|
+
let reslicedSeries = {};
|
|
35
|
+
let reslicedSeriesId = uuidv4();
|
|
36
|
+
let reslicedMetaData = getReslicedMetadata(
|
|
37
|
+
reslicedSeriesId,
|
|
38
|
+
"axial",
|
|
39
|
+
orientation,
|
|
40
|
+
seriesData,
|
|
41
|
+
"resliceLoader"
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
reslicedSeries.imageIds = reslicedMetaData.imageIds;
|
|
45
|
+
reslicedSeries.instances = reslicedMetaData.instances;
|
|
46
|
+
|
|
47
|
+
reslicedSeries.currentImageIdIndex = Math.floor(
|
|
48
|
+
reslicedSeries.imageIds.length / 2
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
function computeReslice(seriesData, reslicedSeriesId, reslicedSeries) {
|
|
52
|
+
let t0 = performance.now();
|
|
53
|
+
let imageTracker = getLarvitarImageTracker();
|
|
54
|
+
let manager = getLarvitarManager();
|
|
55
|
+
each(reslicedSeries.imageIds, function (imageId) {
|
|
56
|
+
reslicedSeries.instances[imageId].pixelData = getReslicedPixeldata(
|
|
57
|
+
imageId,
|
|
58
|
+
seriesData,
|
|
59
|
+
reslicedSeries
|
|
60
|
+
);
|
|
61
|
+
imageTracker[imageId] = reslicedSeriesId;
|
|
62
|
+
});
|
|
63
|
+
larvitar_store.addSeriesIds(reslicedSeriesId, reslicedSeries.imageIds);
|
|
64
|
+
reslicedSeries.numberOfImages = reslicedSeries.imageIds.length;
|
|
65
|
+
reslicedSeries.seriesUID = reslicedSeriesId;
|
|
66
|
+
reslicedSeries.seriesDescription = seriesData.seriesDescription;
|
|
67
|
+
reslicedSeries.orientation = orientation;
|
|
68
|
+
manager[reslicedSeriesId] = reslicedSeries;
|
|
69
|
+
manager[seriesData.seriesUID][orientation] = reslicedSeriesId;
|
|
70
|
+
let t1 = performance.now();
|
|
71
|
+
console.log(`Call to resliceSeries took ${t1 - t0} milliseconds.`);
|
|
72
|
+
resolve(reslicedSeries);
|
|
73
|
+
}
|
|
74
|
+
// reslice the data
|
|
75
|
+
computeReslice(seriesData, reslicedSeriesId, reslicedSeries);
|
|
76
|
+
});
|
|
77
|
+
return reslicePromise;
|
|
78
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @module imaging/
|
|
1
|
+
/** @module imaging/imageStore
|
|
2
2
|
* @desc This file provides functionalities
|
|
3
3
|
* for data config store.
|
|
4
4
|
*/
|
|
@@ -259,15 +259,16 @@ class Larvitar_Store {
|
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* Instancing the store
|
|
262
|
-
* @param {Object}
|
|
263
|
-
* @param {String}
|
|
262
|
+
* @param {Object} vuexStore - The app vuex store [optional]
|
|
263
|
+
* @param {String} vuexModule - The name of the vuex store module, can be null
|
|
264
|
+
* @param {Boolean} registerModule - If true, the module is registered under Vuex global store
|
|
264
265
|
*/
|
|
265
266
|
|
|
266
|
-
export function initLarvitarStore(
|
|
267
|
-
if (
|
|
268
|
-
larvitar_store = new Larvitar_Store(
|
|
267
|
+
export function initLarvitarStore(vuexStore, vuexModule, registerModule) {
|
|
268
|
+
if (vuexStore) {
|
|
269
|
+
larvitar_store = new Larvitar_Store(vuexStore, vuexModule);
|
|
269
270
|
if (registerModule) {
|
|
270
|
-
|
|
271
|
+
vuexStore.registerModule(vuexModule, larvitar);
|
|
271
272
|
}
|
|
272
273
|
} else {
|
|
273
274
|
larvitar_store = new Larvitar_Store();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @module imaging/
|
|
1
|
+
/** @module imaging/imageTools
|
|
2
2
|
* @desc This file provides functionalities for
|
|
3
3
|
* interacting with cornerstone tools
|
|
4
4
|
*/
|
|
@@ -9,20 +9,20 @@ import cornerstoneTools from "cornerstone-tools";
|
|
|
9
9
|
import { each, extend, filter, remove, cloneDeep } from "lodash";
|
|
10
10
|
|
|
11
11
|
// internal libraries
|
|
12
|
-
import { DEFAULT_TOOLS } from "./tools/
|
|
13
|
-
// import { SeedsTool } from "./tools/seedTool";
|
|
14
|
-
import { ContoursTool } from "./tools/contourTool";
|
|
15
|
-
import { EditMaskTool } from "./tools/editMaskTool";
|
|
16
|
-
import { DiameterTool } from "./tools/diameterTool";
|
|
12
|
+
import { DEFAULT_TOOLS } from "./tools/default";
|
|
13
|
+
// import { SeedsTool } from "./tools/custom/seedTool";
|
|
14
|
+
import { ContoursTool } from "./tools/custom/contourTool";
|
|
15
|
+
import { EditMaskTool } from "./tools/custom/editMaskTool";
|
|
16
|
+
import { DiameterTool } from "./tools/custom/diameterTool";
|
|
17
17
|
import { getImageIdFromSlice } from "./loaders/nrrdLoader";
|
|
18
18
|
import { getSeriesDataFromLarvitarManager } from "./loaders/commonLoader";
|
|
19
|
-
import { parseContours } from "./
|
|
20
|
-
import { isElement } from "./
|
|
19
|
+
import { parseContours } from "./imageContours";
|
|
20
|
+
import { isElement } from "./imageUtils";
|
|
21
21
|
|
|
22
22
|
/*
|
|
23
23
|
* This module provides the following functions to be exported:
|
|
24
24
|
* csToolsCreateStack(element)
|
|
25
|
-
* addDefaultTools()
|
|
25
|
+
* addDefaultTools(toolToActivate)
|
|
26
26
|
* clearMeasurements()
|
|
27
27
|
* addContoursTool(rawContours, maskName)
|
|
28
28
|
* addMaskEditingTool(seriesId,mask,setConfig,callback, targetViewport)
|
|
@@ -44,11 +44,11 @@ import { isElement } from "./image_utils";
|
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Add all default tools, as listed in tools
|
|
47
|
+
* Add all default tools, as listed in tools/default.js
|
|
48
48
|
* @function addDefaultTools
|
|
49
49
|
* @deprecated (OBSOLETE)
|
|
50
50
|
*/
|
|
51
|
-
export const addDefaultTools = function (toolToActivate
|
|
51
|
+
export const addDefaultTools = function (toolToActivate) {
|
|
52
52
|
// for each default tool
|
|
53
53
|
each(DEFAULT_TOOLS, tool => {
|
|
54
54
|
// check if already added
|
|
@@ -99,10 +99,6 @@ export const addDefaultTools = function (toolToActivate, cb) {
|
|
|
99
99
|
allowSkipping: false, // default true
|
|
100
100
|
invert: false
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
if (cb) {
|
|
104
|
-
cb();
|
|
105
|
-
}
|
|
106
102
|
};
|
|
107
103
|
|
|
108
104
|
/**
|
|
@@ -146,8 +142,8 @@ export const addContoursTool = function (rawContours, maskName) {
|
|
|
146
142
|
* Add mask editing tool
|
|
147
143
|
* @function addMaskEditingTool
|
|
148
144
|
* @param {Array} mask - The mask data.
|
|
149
|
-
* @param {String} targetViewport - The target hmtl element id.
|
|
150
145
|
* @param {Function} callback - The tool initialization callback
|
|
146
|
+
* @param {String} targetViewport - The target hmtl element id.
|
|
151
147
|
*/
|
|
152
148
|
export const addMaskEditingTool = function (mask, callback, targetViewport) {
|
|
153
149
|
let enabledElements = cornerstone.getEnabledElements();
|
|
@@ -257,10 +253,10 @@ export const addSeedsTool = function (preLoadSeeds, initViewport) {
|
|
|
257
253
|
};
|
|
258
254
|
|
|
259
255
|
/**
|
|
260
|
-
* Delete all measurements from tools state, for tools that have the "cleaneable" prop set to true in tools
|
|
256
|
+
* Delete all measurements from tools state, for tools that have the "cleaneable" prop set to true in tools/default.js
|
|
261
257
|
* @function clearMeasurements
|
|
262
258
|
*/
|
|
263
|
-
export const clearMeasurements = function (
|
|
259
|
+
export const clearMeasurements = function () {
|
|
264
260
|
let enabledElements = cornerstone.getEnabledElements();
|
|
265
261
|
let clenableTools = filter(DEFAULT_TOOLS, "cleanable");
|
|
266
262
|
|
|
@@ -272,17 +268,13 @@ export const clearMeasurements = function (cb) {
|
|
|
272
268
|
each(enabledElements, el => {
|
|
273
269
|
cornerstone.updateImage(el.element);
|
|
274
270
|
});
|
|
275
|
-
|
|
276
|
-
if (cb) {
|
|
277
|
-
cb();
|
|
278
|
-
}
|
|
279
271
|
};
|
|
280
272
|
|
|
281
273
|
/**
|
|
282
274
|
* Set Tool "active" on all elements (ie, rendered and manipulable) & refresh cornerstone elements
|
|
283
275
|
* @function setToolActive
|
|
284
276
|
* @param {String} toolName - The tool name.
|
|
285
|
-
* @param {Object} options - The custom options. @default from tools
|
|
277
|
+
* @param {Object} options - The custom options. @default from tools/default.js
|
|
286
278
|
* @param {String} activeViewport - The active viewport (if "all", viewports array will be used)
|
|
287
279
|
* @param {Array} viewports - The hmtl element id to be used for tool initialization.
|
|
288
280
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// external libraries
|
|
7
7
|
import cornerstoneWADOImageLoader from "cornerstone-wado-image-loader";
|
|
8
8
|
import { each } from "lodash";
|
|
9
|
-
import { updateLoadedStack } from "../
|
|
9
|
+
import { updateLoadedStack } from "../imageLoading";
|
|
10
10
|
|
|
11
11
|
// internal libraries
|
|
12
12
|
import { buildMultiFrameImage, clearMultiFrameCache } from "./multiframeLoader";
|
|
@@ -8,8 +8,8 @@ import cornerstoneFileImageLoader from "cornerstone-file-image-loader";
|
|
|
8
8
|
import { has } from "lodash";
|
|
9
9
|
|
|
10
10
|
// internal libraries
|
|
11
|
-
import { clearImageCache } from "../
|
|
12
|
-
import { clearCornerstoneElements } from "../
|
|
11
|
+
import { clearImageCache } from "../imageRendering";
|
|
12
|
+
import { clearCornerstoneElements } from "../imageTools";
|
|
13
13
|
|
|
14
14
|
// global variables
|
|
15
15
|
export var fileManager = {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** @module loaders/multiframeLoader
|
|
2
|
+
* @desc This file is a custom wado loader for multiframe images
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
// external libraries
|
|
2
6
|
import cornerstoneWADOImageLoader from "cornerstone-wado-image-loader";
|
|
3
7
|
import { each, range } from "lodash";
|
|
@@ -8,7 +12,7 @@ import {
|
|
|
8
12
|
getLarvitarImageTracker,
|
|
9
13
|
getLarvitarManager
|
|
10
14
|
} from "./commonLoader";
|
|
11
|
-
import {
|
|
15
|
+
import { parseDataSet } from "../imageParsing";
|
|
12
16
|
|
|
13
17
|
// global module variables
|
|
14
18
|
let customImageLoaderCounter = 0;
|
|
@@ -84,7 +88,7 @@ export const buildMultiFrameImage = function (seriesId, serie) {
|
|
|
84
88
|
// EXTRACT MULTIFRAME METADATA (x52009230) Per-frame Functional Groups Sequence
|
|
85
89
|
let frameMetadata = { ...metadata };
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
parseDataSet(dataSet, frameMetadata, {
|
|
88
92
|
tags: ["x52009230"],
|
|
89
93
|
frameId: frameNumber
|
|
90
94
|
});
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getNormalOrientation,
|
|
15
15
|
getPixelRepresentation,
|
|
16
16
|
getTypedArrayFromDataType
|
|
17
|
-
} from "../
|
|
17
|
+
} from "../imageUtils";
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
getImageFrame,
|
|
@@ -243,7 +243,11 @@ export const loadNrrdImage = function (imageId) {
|
|
|
243
243
|
* @param {String} seriesId The series id
|
|
244
244
|
* @return {String} image id
|
|
245
245
|
*/
|
|
246
|
-
export
|
|
246
|
+
export const getImageIdFromSlice = function (
|
|
247
|
+
sliceNumber,
|
|
248
|
+
orientation,
|
|
249
|
+
seriesId
|
|
250
|
+
) {
|
|
247
251
|
var prefix = "nrrdLoader://";
|
|
248
252
|
var serieImageTracker;
|
|
249
253
|
let imageTracker = getLarvitarImageTracker();
|
|
@@ -266,7 +270,7 @@ export function getImageIdFromSlice(sliceNumber, orientation, seriesId) {
|
|
|
266
270
|
var imageId = prefix.concat(imageIndex.toString());
|
|
267
271
|
|
|
268
272
|
return imageId;
|
|
269
|
-
}
|
|
273
|
+
};
|
|
270
274
|
|
|
271
275
|
/**
|
|
272
276
|
* Retrieve slice number for a the given orientation
|
|
@@ -277,7 +281,7 @@ export function getImageIdFromSlice(sliceNumber, orientation, seriesId) {
|
|
|
277
281
|
* @param {String} seriesId The series id
|
|
278
282
|
* @return {Integer} The image slice number
|
|
279
283
|
*/
|
|
280
|
-
export function
|
|
284
|
+
export const getSliceNumberFromImageId = function (imageId, orientation) {
|
|
281
285
|
let imageTracker = getLarvitarImageTracker();
|
|
282
286
|
var firstImageId = findKey(imageTracker, entry => {
|
|
283
287
|
return entry[1] == orientation;
|
|
@@ -289,7 +293,7 @@ export function getSliceNumberFromImageId(imageId, orientation) {
|
|
|
289
293
|
parseInt(imageNumber) - parseInt(firstImageId.split("//").pop());
|
|
290
294
|
|
|
291
295
|
return imageIndex;
|
|
292
|
-
}
|
|
296
|
+
};
|
|
293
297
|
|
|
294
298
|
/**
|
|
295
299
|
* Get series dimension for each view
|
|
@@ -297,7 +301,7 @@ export function getSliceNumberFromImageId(imageId, orientation) {
|
|
|
297
301
|
* @function getNrrdSerieDimensions
|
|
298
302
|
* @return {Object} Series dimension for each view
|
|
299
303
|
*/
|
|
300
|
-
export function
|
|
304
|
+
export const getNrrdSerieDimensions = function () {
|
|
301
305
|
let imageTracker = getLarvitarImageTracker();
|
|
302
306
|
var dim_axial = filter(imageTracker, img => {
|
|
303
307
|
return img[1] == "axial";
|
|
@@ -314,7 +318,7 @@ export function getNrrdSerieDimensions() {
|
|
|
314
318
|
coronal: [dim_sagittal.length, dim_axial.length, dim_coronal.length],
|
|
315
319
|
sagittal: [dim_coronal.length, dim_axial.length, dim_sagittal.length]
|
|
316
320
|
};
|
|
317
|
-
}
|
|
321
|
+
};
|
|
318
322
|
|
|
319
323
|
/* Internal functions */
|
|
320
324
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/contourTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* rendering segmentation contours with a
|
|
4
|
+
* custom cornestone tool
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
// external libraries
|
|
2
8
|
import cornerstone from "cornerstone-core";
|
|
3
9
|
import csTools from "cornerstone-tools";
|
|
4
10
|
import { each, map } from "lodash";
|
|
5
11
|
|
|
6
12
|
// internal libraries
|
|
7
|
-
import { addToolStateSingleSlice } from "
|
|
13
|
+
import { addToolStateSingleSlice } from "../../imageTools";
|
|
8
14
|
|
|
9
15
|
// cornerstone tools imports
|
|
10
16
|
const external = csTools.external;
|
|
@@ -99,19 +105,16 @@ export class ContoursTool extends BaseAnnotationTool {
|
|
|
99
105
|
this._drawingMouseMoveCallback = this._drawingMouseMoveCallback.bind(this);
|
|
100
106
|
this._drawingMouseDragCallback = this._drawingMouseDragCallback.bind(this);
|
|
101
107
|
this._drawingMouseUpCallback = this._drawingMouseUpCallback.bind(this);
|
|
102
|
-
this._drawingMouseDoubleClickCallback =
|
|
103
|
-
this
|
|
104
|
-
);
|
|
108
|
+
this._drawingMouseDoubleClickCallback =
|
|
109
|
+
this._drawingMouseDoubleClickCallback.bind(this);
|
|
105
110
|
this._editMouseUpCallback = this._editMouseUpCallback.bind(this);
|
|
106
111
|
this._editMouseDragCallback = this._editMouseDragCallback.bind(this);
|
|
107
112
|
|
|
108
|
-
this._drawingTouchStartCallback =
|
|
109
|
-
this
|
|
110
|
-
);
|
|
113
|
+
this._drawingTouchStartCallback =
|
|
114
|
+
this._drawingTouchStartCallback.bind(this);
|
|
111
115
|
this._drawingTouchDragCallback = this._drawingTouchDragCallback.bind(this);
|
|
112
|
-
this._drawingDoubleTapClickCallback =
|
|
113
|
-
this
|
|
114
|
-
);
|
|
116
|
+
this._drawingDoubleTapClickCallback =
|
|
117
|
+
this._drawingDoubleTapClickCallback.bind(this);
|
|
115
118
|
this._editTouchDragCallback = this._editTouchDragCallback.bind(this);
|
|
116
119
|
|
|
117
120
|
this.throttledUpdateCachedStats = throttle(this.updateCachedStats, 110);
|
|
@@ -1340,11 +1343,12 @@ export class ContoursTool extends BaseAnnotationTool {
|
|
|
1340
1343
|
|
|
1341
1344
|
data.canComplete = false;
|
|
1342
1345
|
|
|
1343
|
-
const mouseAtOriginHandle =
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
const mouseAtOriginHandle =
|
|
1347
|
+
this._isDistanceSmallerThanCompleteSpacingCanvas(
|
|
1348
|
+
element,
|
|
1349
|
+
points[0],
|
|
1350
|
+
mousePoint
|
|
1351
|
+
);
|
|
1348
1352
|
|
|
1349
1353
|
if (
|
|
1350
1354
|
mouseAtOriginHandle &&
|
|
@@ -1398,11 +1402,12 @@ export class ContoursTool extends BaseAnnotationTool {
|
|
|
1398
1402
|
const mousePoint = config.mouseLocation.handles.start;
|
|
1399
1403
|
const points = data.handles.points;
|
|
1400
1404
|
|
|
1401
|
-
const mouseAtOriginHandle =
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1405
|
+
const mouseAtOriginHandle =
|
|
1406
|
+
this._isDistanceSmallerThanCompleteSpacingCanvas(
|
|
1407
|
+
element,
|
|
1408
|
+
points[0],
|
|
1409
|
+
mousePoint
|
|
1410
|
+
);
|
|
1406
1411
|
|
|
1407
1412
|
if (mouseAtOriginHandle) {
|
|
1408
1413
|
data.canComplete = true;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/** @module imaging/tools/custom/diameterTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a custom diameter cornestone tool
|
|
4
|
+
*/
|
|
2
5
|
|
|
6
|
+
// external libraries
|
|
7
|
+
import csTools from "cornerstone-tools";
|
|
3
8
|
const BidirectionalTool = csTools.BidirectionalTool;
|
|
4
|
-
|
|
5
|
-
import { addToolStateSingleSlice } from "../image_tools";
|
|
6
9
|
import { each } from "lodash";
|
|
7
10
|
|
|
11
|
+
// internal libraries
|
|
12
|
+
import { addToolStateSingleSlice } from "../../imageTools";
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* @public
|
|
10
16
|
* @class DiameterTool
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/editMaskTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a custom mask cornestone tool
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// external libraries
|
|
1
7
|
import csTools from "cornerstone-tools";
|
|
2
8
|
const external = csTools.external;
|
|
3
9
|
const BaseBrushTool = csTools.importInternal("base/BaseBrushTool");
|
|
@@ -95,7 +101,7 @@ export class EditMaskTool extends BaseBrushTool {
|
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
preventCtrl() {
|
|
98
|
-
this.__proto__.__proto__._isCtrlDown = function() {
|
|
104
|
+
this.__proto__.__proto__._isCtrlDown = function () {
|
|
99
105
|
return false;
|
|
100
106
|
};
|
|
101
107
|
}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/polygonScissorsTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a custom polyline scissors cornestone tool
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// external libraries
|
|
1
7
|
import cornerstoneTools from "cornerstone-tools";
|
|
8
|
+
const BaseTool = cornerstoneTools.importInternal("base/BaseTool");
|
|
9
|
+
const { rectangleRoiCursor } = cornerstoneTools.importInternal("tools/cursors");
|
|
10
|
+
|
|
11
|
+
// internal libraries
|
|
2
12
|
import {
|
|
3
13
|
fillInsideFreehand,
|
|
4
14
|
fillOutsideFreehand,
|
|
5
15
|
eraseOutsideFreehand,
|
|
6
16
|
eraseInsideFreehand
|
|
7
|
-
} from "
|
|
8
|
-
import polygonSegmentationMixin from "
|
|
9
|
-
|
|
10
|
-
const BaseTool = cornerstoneTools.importInternal("base/BaseTool");
|
|
11
|
-
const { rectangleRoiCursor } = cornerstoneTools.importInternal("tools/cursors");
|
|
17
|
+
} from "../strategies"; // cannot import strategies in other way 🤷
|
|
18
|
+
import polygonSegmentationMixin from "../polygonSegmentationMixin";
|
|
12
19
|
|
|
13
20
|
// Register custom mixin
|
|
14
21
|
cornerstoneTools.register(
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// import { each, cloneDeep } from "lodash";
|
|
4
4
|
|
|
5
5
|
// // internal libraries
|
|
6
|
-
// import { remapVoxel } from "
|
|
7
|
-
// import { addToolStateSingleSlice, setToolEnabled } from "
|
|
8
|
-
// import { getSliceNumberFromImageId } from "
|
|
6
|
+
// import { remapVoxel } from "../../imageUtils";
|
|
7
|
+
// import { addToolStateSingleSlice, setToolEnabled } from "../../imageTools";
|
|
8
|
+
// import { getSliceNumberFromImageId } from "../../loaders/nrrdLoader";
|
|
9
9
|
|
|
10
10
|
// // cornerstone tools imports
|
|
11
11
|
// const BaseAnnotationTool = csTools.importInternal("base/BaseAnnotationTool");
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/** @module imaging/tools/custom/thresholdBrushTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a brush tool with thresholds using a
|
|
4
|
+
* custom cornestone tool
|
|
5
|
+
*/
|
|
2
6
|
|
|
7
|
+
// external libraries
|
|
8
|
+
import cornerstoneTools from "cornerstone-tools";
|
|
3
9
|
const external = cornerstoneTools.external;
|
|
4
10
|
const BaseBrushTool = cornerstoneTools.importInternal("base/BaseBrushTool");
|
|
5
11
|
const segmentationUtils = cornerstoneTools.importInternal(
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** @module imaging/tools/default
|
|
2
|
+
* @desc This file provides definitions
|
|
3
|
+
* for default tools
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// external libraries
|
|
7
|
+
|
|
1
8
|
/** @module tools/default */
|
|
2
9
|
|
|
3
10
|
/* DEFINE DEFAULT TOOLS
|
|
@@ -19,8 +26,8 @@
|
|
|
19
26
|
*/
|
|
20
27
|
|
|
21
28
|
import { filter, isArray } from "lodash";
|
|
22
|
-
import ThresholdsBrushTool from "./thresholdsBrushTool";
|
|
23
|
-
import PolylineScissorsTool from "./polylineScissorsTool";
|
|
29
|
+
import ThresholdsBrushTool from "./custom/thresholdsBrushTool";
|
|
30
|
+
import PolylineScissorsTool from "./custom/polylineScissorsTool";
|
|
24
31
|
|
|
25
32
|
/**
|
|
26
33
|
* These tools are added with `addDefaultTools()`
|
|
@@ -416,7 +423,7 @@ const DEFAULT_STYLE = {
|
|
|
416
423
|
*/
|
|
417
424
|
const DEFAULT_SETTINGS = {
|
|
418
425
|
mouseEnabled: true,
|
|
419
|
-
touchEnabled:
|
|
426
|
+
touchEnabled: true,
|
|
420
427
|
showSVGCursors: true,
|
|
421
428
|
globalToolSyncEnabled: false,
|
|
422
429
|
autoResizeViewports: true,
|