larvitar 1.2.0 → 1.2.1
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/build-docs.yml +1 -1
- package/.github/workflows/deploy.yml +4 -4
- package/README.md +3 -3
- package/modules/vuex/larvitar.js +1 -0
- package/package.json +1 -1
- package/docs/documentation/Mixins.polygonSegmentationMixin%20-%20segmentation%20operations%20for%20polyline.html +0 -171
- package/docs/documentation/Tools.Annotation.ContoursTool.html +0 -218
- package/docs/documentation/Tools.Annotation.DiameterTool.html +0 -219
- package/docs/documentation/Tools.Annotation.SeedsTool.html +0 -214
- package/docs/documentation/Tools.Brush.BrushTool.html +0 -218
- package/docs/documentation/Tools.Brush.ThresholdsBrushTool.html +0 -218
- package/docs/documentation/Tools.PolylineScissorsTool.html +0 -218
- 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 +0 -978
- 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 +0 -1049
- 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 +0 -1303
- package/docs/documentation/imageAnonymization.js.html +0 -245
- package/docs/documentation/imageColormaps.js.html +0 -283
- package/docs/documentation/imageContours.js.html +0 -278
- package/docs/documentation/imageIo.js.html +0 -291
- package/docs/documentation/imageLayers.js.html +0 -188
- package/docs/documentation/imageLoading.js.html +0 -297
- package/docs/documentation/imageParsing.js.html +0 -385
- package/docs/documentation/imagePresets.js.html +0 -207
- package/docs/documentation/imageRendering.js.html +0 -849
- package/docs/documentation/imageReslice.js.html +0 -162
- package/docs/documentation/imageStore.js.html +0 -360
- package/docs/documentation/imageTools.js.html +0 -784
- package/docs/documentation/imageUtils.js.html +0 -1609
- package/docs/documentation/image_colormaps.js.html +0 -283
- package/docs/documentation/image_contours.js.html +0 -279
- package/docs/documentation/image_io.js.html +0 -288
- package/docs/documentation/image_layers.js.html +0 -188
- package/docs/documentation/image_loading.js.html +0 -294
- package/docs/documentation/image_parsing.js.html +0 -391
- package/docs/documentation/image_presets.js.html +0 -207
- package/docs/documentation/image_rendering.js.html +0 -845
- package/docs/documentation/image_reslice.js.html +0 -164
- package/docs/documentation/image_store.js.html +0 -359
- package/docs/documentation/image_tools.js.html +0 -792
- package/docs/documentation/image_utils.js.html +0 -1609
- package/docs/documentation/index.html +0 -175
- package/docs/documentation/loaders_commonLoader.js.html +0 -306
- package/docs/documentation/loaders_dicomLoader.js.html +0 -130
- package/docs/documentation/loaders_fileLoader.js.html +0 -155
- package/docs/documentation/loaders_multiframeLoader.js.html +0 -443
- package/docs/documentation/loaders_niftiLoader.js.html +0 -150
- package/docs/documentation/loaders_nrrdLoader.js.html +0 -545
- package/docs/documentation/loaders_resliceLoader.js.html +0 -258
- package/docs/documentation/module-imaging_contours.html +0 -954
- package/docs/documentation/module-imaging_imageAnonymization.html +0 -544
- package/docs/documentation/module-imaging_imageColormaps.html +0 -1012
- package/docs/documentation/module-imaging_imageContours.html +0 -954
- package/docs/documentation/module-imaging_imageIo.html +0 -1057
- package/docs/documentation/module-imaging_imageLayers.html +0 -904
- package/docs/documentation/module-imaging_imageLoading.html +0 -1301
- package/docs/documentation/module-imaging_imageParsing.html +0 -1356
- package/docs/documentation/module-imaging_imagePresets.html +0 -679
- package/docs/documentation/module-imaging_imageRendering.html +0 -3223
- package/docs/documentation/module-imaging_imageReslice.html +0 -413
- package/docs/documentation/module-imaging_imageStore-Larvitar_Store.html +0 -284
- package/docs/documentation/module-imaging_imageStore.html +0 -1560
- package/docs/documentation/module-imaging_imageTools.html +0 -3617
- package/docs/documentation/module-imaging_imageUtils.html +0 -7253
- package/docs/documentation/module-imaging_io.html +0 -1057
- package/docs/documentation/module-imaging_layers.html +0 -904
- package/docs/documentation/module-imaging_loading.html +0 -1301
- package/docs/documentation/module-imaging_parsing.html +0 -1375
- package/docs/documentation/module-imaging_presets.html +0 -679
- package/docs/documentation/module-imaging_rendering.html +0 -8094
- package/docs/documentation/module-imaging_reslice.html +0 -411
- package/docs/documentation/module-imaging_store-Larvitar_Store.html +0 -284
- package/docs/documentation/module-imaging_store.html +0 -1537
- package/docs/documentation/module-imaging_strategies_eraseFreehand.html +0 -708
- package/docs/documentation/module-imaging_strategies_fillFreehand.html +0 -708
- package/docs/documentation/module-imaging_tools.html +0 -3617
- package/docs/documentation/module-imaging_tools_custom_contourTool.html +0 -207
- package/docs/documentation/module-imaging_tools_custom_diameterTool.html +0 -205
- package/docs/documentation/module-imaging_tools_custom_editMaskTool.html +0 -205
- package/docs/documentation/module-imaging_tools_custom_polygonScissorsTool.html +0 -203
- package/docs/documentation/module-imaging_tools_custom_thresholdBrushTool.html +0 -684
- package/docs/documentation/module-imaging_tools_default.html +0 -205
- package/docs/documentation/module-imaging_tools_interaction.html +0 -530
- package/docs/documentation/module-imaging_tools_io.html +0 -832
- package/docs/documentation/module-imaging_tools_main.html +0 -2028
- package/docs/documentation/module-imaging_tools_polygonSegmentationMixin.html +0 -567
- package/docs/documentation/module-imaging_tools_segmentation.html +0 -3586
- package/docs/documentation/module-imaging_tools_state.html +0 -494
- package/docs/documentation/module-imaging_utils.html +0 -7253
- package/docs/documentation/module-loaders_commonLoader.html +0 -1313
- package/docs/documentation/module-loaders_dicomLoader.html +0 -522
- package/docs/documentation/module-loaders_fileLoader.html +0 -593
- package/docs/documentation/module-loaders_multiframeLoader.html +0 -1169
- package/docs/documentation/module-loaders_niftiLoader.html +0 -565
- package/docs/documentation/module-loaders_nrrdLoader.html +0 -1459
- package/docs/documentation/module-loaders_resliceLoader.html +0 -590
- package/docs/documentation/module-monitors_memory.html +0 -980
- package/docs/documentation/module-tools_default.html +0 -740
- package/docs/documentation/module.exports_module.exports.html +0 -203
- package/docs/documentation/monitors_memory.js.html +0 -189
- package/docs/documentation/parsers_nrrd.js.html +0 -569
- package/docs/documentation/scripts/collapse.js +0 -20
- package/docs/documentation/scripts/linenumber.js +0 -25
- package/docs/documentation/scripts/nav.js +0 -12
- package/docs/documentation/scripts/polyfill.js +0 -4
- package/docs/documentation/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/documentation/scripts/prettify/lang-css.js +0 -2
- package/docs/documentation/scripts/prettify/prettify.js +0 -28
- package/docs/documentation/scripts/search.js +0 -83
- package/docs/documentation/styles/jsdoc.css +0 -765
- package/docs/documentation/styles/prettify.css +0 -80
- package/docs/documentation/tools_contourTool.js.html +0 -1963
- package/docs/documentation/tools_custom_contourTool.js.html +0 -1968
- package/docs/documentation/tools_custom_diameterTool.js.html +0 -225
- package/docs/documentation/tools_custom_editMaskTool.js.html +0 -225
- package/docs/documentation/tools_custom_polylineScissorsTool.js.html +0 -143
- package/docs/documentation/tools_custom_thresholdsBrushTool.js.html +0 -245
- package/docs/documentation/tools_default.js.html +0 -576
- package/docs/documentation/tools_diameterTool.js.html +0 -219
- package/docs/documentation/tools_editMaskTool.js.html +0 -219
- package/docs/documentation/tools_interaction.js.html +0 -258
- package/docs/documentation/tools_io.js.html +0 -297
- package/docs/documentation/tools_main.js.html +0 -443
- package/docs/documentation/tools_polygonSegmentationMixin.js.html +0 -329
- package/docs/documentation/tools_polylineScissorsTool.js.html +0 -136
- package/docs/documentation/tools_seedTool.js.html +0 -423
- package/docs/documentation/tools_segmentation.js.html +0 -558
- package/docs/documentation/tools_state.js.html +0 -163
- package/docs/documentation/tools_strategies_eraseFreehand.js.html +0 -160
- package/docs/documentation/tools_strategies_fillFreehand.js.html +0 -163
- package/docs/documentation/tools_thresholdsBrushTool.js.html +0 -239
- package/docs/documentation/tools_tools.default.js.html +0 -569
- package/docs/documentation/tools_tools.interaction.js.html +0 -251
- package/docs/documentation/tools_tools.io.js.html +0 -288
- package/docs/documentation/tools_tools.main.js.html +0 -442
- package/docs/documentation/tools_tools.segmentation.js.html +0 -445
- package/docs/documentation/tools_tools.state.js.html +0 -157
- package/docs/examples/base.html +0 -170
- package/docs/examples/colorMaps.html +0 -181
- package/docs/examples/defaultTools.html +0 -246
- 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 +0 -129
- package/docs/examples/larvitar.js +0 -108623
- package/docs/examples/layers.html +0 -250
- package/docs/examples/masks.html +0 -273
- package/docs/examples/multiframe.html +0 -200
- package/docs/examples/nrrd.html +0 -96
- package/docs/examples/reslice.html +0 -174
- package/docs/index.html +0 -92
|
@@ -1,845 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<title>image_rendering.js - Larvitar</title>
|
|
7
|
-
|
|
8
|
-
<meta name="description" content="Dicom Image Toolkit for CornestoneJS" />
|
|
9
|
-
|
|
10
|
-
<meta name="keywords" content="imaging, dataviz, medical, cornerstone" />
|
|
11
|
-
<meta name="keyword" content="imaging, dataviz, medical, cornerstone" />
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<script src="scripts/prettify/prettify.js"></script>
|
|
16
|
-
<script src="scripts/prettify/lang-css.js"></script>
|
|
17
|
-
<!--[if lt IE 9]>
|
|
18
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
19
|
-
<![endif]-->
|
|
20
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
21
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
22
|
-
<script src="scripts/nav.js" defer></script>
|
|
23
|
-
|
|
24
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
25
|
-
</head>
|
|
26
|
-
<body>
|
|
27
|
-
|
|
28
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
29
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
30
|
-
<div class="navicon"></div>
|
|
31
|
-
</label>
|
|
32
|
-
|
|
33
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
34
|
-
|
|
35
|
-
<nav >
|
|
36
|
-
|
|
37
|
-
<input type="text" id="nav-search" placeholder="Search" />
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/dvisionlab/Larvitar" target="_blank" class="menu-item" id="repository" >Github repo</a></h2><h3>Classes</h3><ul><li><a href="module.exports_module.exports.html">module.exports#module.exports</a></li><li><a href="module-imaging_store-Larvitar_Store.html">imaging/store~Larvitar_Store</a></li><li><a href="Tools.Annotation.ContoursTool.html">Tools.Annotation.ContoursTool</a></li><li><a href="Tools.Annotation.DiameterTool.html">Tools.Annotation.DiameterTool</a></li><li><a href="Tools.Brush.BrushTool.html">Tools.Brush.BrushTool</a></li><li><a href="Tools.Brush.ThresholdsBrushTool.html">Tools.Brush.ThresholdsBrushTool</a></li><li><a href="Tools.PolylineScissorsTool.html">Tools.PolylineScissorsTool</a></li></ul><h3>Modules</h3><ul><li><a href="module-imaging_anonymization.html">imaging/anonymization</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_anonymization.html#anonymize#~anonymize">anonymize</a></li><li data-type='method' style='display: none;'><a href="module-imaging_anonymization.html#encrypt#~encrypt">encrypt</a></li></ul></li><li><a href="module-imaging_contours.html">imaging/contours</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_contours.html#extractSlicePoints#extractSlicePoints">extractSlicePoints</a></li><li data-type='method' style='display: none;'><a href="module-imaging_contours.html#populateContoursObject#populateContoursObject">populateContoursObject</a></li><li data-type='method' style='display: none;'><a href="module-imaging_contours.html#parseContours#~parseContours">parseContours</a></li></ul></li><li><a href="module-imaging_io.html">imaging/io</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_io.html#buildData#~buildData">buildData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_io.html#buildDataAsync#~buildDataAsync">buildDataAsync</a></li><li data-type='method' style='display: none;'><a href="module-imaging_io.html#buildHeader#~buildHeader">buildHeader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_io.html#getCachedPixelData#~getCachedPixelData">getCachedPixelData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_io.html#importNRRDImage#~importNRRDImage">importNRRDImage</a></li></ul></li><li><a href="module-imaging_layers.html">imaging/layers</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_layers.html#getActiveLayer#getActiveLayer">getActiveLayer</a></li><li data-type='method' style='display: none;'><a href="module-imaging_layers.html#setActiveLayer#setActiveLayer">setActiveLayer</a></li><li data-type='method' style='display: none;'><a href="module-imaging_layers.html#updateLayer#updateLayer">updateLayer</a></li><li data-type='method' style='display: none;'><a href="module-imaging_layers.html#buildLayers#~buildLayers">buildLayers</a></li></ul></li><li><a href="module-imaging_loading.html">imaging/loading</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#initializeFileImageLoader#initializeFileImageLoader">initializeFileImageLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#initializeImageLoader#initializeImageLoader">initializeImageLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#initializeWebImageLoader#initializeWebImageLoader">initializeWebImageLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#registerMultiFrameImageLoader#registerMultiFrameImageLoader">registerMultiFrameImageLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#registerNRRDImageLoader#registerNRRDImageLoader">registerNRRDImageLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#registerResliceLoader#registerResliceLoader">registerResliceLoader</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#updateLoadedStack#updateLoadedStack">updateLoadedStack</a></li><li data-type='method' style='display: none;'><a href="module-imaging_loading.html#isNewInstance#~isNewInstance">isNewInstance</a></li></ul></li><li><a href="module-imaging_parsing.html">imaging/parsing</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#clearImageParsing#clearImageParsing">clearImageParsing</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#dumpDataSet#dumpDataSet">dumpDataSet</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#readFile#readFile">readFile</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#readFiles#readFiles">readFiles</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#dumpFile#~dumpFile">dumpFile</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#dumpFiles#~dumpFiles">dumpFiles</a></li><li data-type='method' style='display: none;'><a href="module-imaging_parsing.html#parseNextFile#~parseNextFile">parseNextFile</a></li></ul></li><li><a href="module-imaging_presets.html">imaging/presets</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_presets.html#getImagePresets#getImagePresets">getImagePresets</a></li><li data-type='method' style='display: none;'><a href="module-imaging_presets.html#setImageCustomPreset#setImageCustomPreset">setImageCustomPreset</a></li><li data-type='method' style='display: none;'><a href="module-imaging_presets.html#setImagePreset#setImagePreset">setImagePreset</a></li></ul></li><li><a href="module-imaging_rendering.html">imaging/rendering</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#HSVToRGB#.HSVToRGB">HSVToRGB</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#addColorMap#addColorMap">addColorMap</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#applyColorMap#applyColorMap">applyColorMap</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#clearImageCache#clearImageCache">clearImageCache</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#disableViewport#disableViewport">disableViewport</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#fillPixelData#fillPixelData">fillPixelData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#flipImageHorizontal#flipImageHorizontal">flipImageHorizontal</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#flipImageVertical#flipImageVertical">flipImageVertical</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#getColormapsList#getColormapsList">getColormapsList</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#getSeriesData#getSeriesData">getSeriesData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#invertImage#invertImage">invertImage</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#loadAndCacheImages#loadAndCacheImages">loadAndCacheImages</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#renderImage#renderImage">renderImage</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#renderWebImage#renderWebImage">renderWebImage</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#renderWebImage#renderWebImage">renderWebImage</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#resetViewports#resetViewports">resetViewports</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#resizeViewport#resizeViewport">resizeViewport</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#rotateImageLeft#rotateImageLeft">rotateImageLeft</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#rotateImageRight#rotateImageRight">rotateImageRight</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#storeViewportData#storeViewportData">storeViewportData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#unloadViewport#unloadViewport">unloadViewport</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#updateImage#updateImage">updateImage</a></li><li data-type='method' style='display: none;'><a href="module-imaging_rendering.html#updateViewportData#updateViewportData">updateViewportData</a></li></ul></li><li></li><li><a href="module-imaging_reslice.html">imaging/reslice</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_reslice.html#resliceSeries#resliceSeries">resliceSeries</a></li></ul></li><li><a href="module-imaging_store.html">imaging/store</a><ul class='members'><li data-type='member' style='display: none;'><a href="module-imaging_store.html#.larvitar_store">larvitar_store</a></li></ul><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_store.html#initLarvitarStore#.initLarvitarStore">initLarvitarStore</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#addSeriesIds#~addSeriesIds">addSeriesIds</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#addViewport#~addViewport">addViewport</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#deleteViewport#~deleteViewport">deleteViewport</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#disableVuex#~disableVuex">disableVuex</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#enableVuex#~enableVuex">enableVuex</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#get#~get">get</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#removeSeriesIds#~removeSeriesIds">removeSeriesIds</a></li><li data-type='method' style='display: none;'><a href="module-imaging_store.html#set#~set">set</a></li></ul></li><li><a href="module-imaging_tools.html">imaging/tools</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addContoursTool#~addContoursTool">addContoursTool</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addDefaultTools#~addDefaultTools">addDefaultTools</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addDiameterTool#~addDiameterTool">addDiameterTool</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addMaskEditingTool#~addMaskEditingTool">addMaskEditingTool</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addSeedsTool#~addSeedsTool">addSeedsTool</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addStackStateToElement#~addStackStateToElement">addStackStateToElement</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#addToolStateSingleSlice#~addToolStateSingleSlice">addToolStateSingleSlice</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#clearCornerstoneElements#~clearCornerstoneElements">clearCornerstoneElements</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#clearMeasurements#~clearMeasurements">clearMeasurements</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#clearToolStateByName#~clearToolStateByName">clearToolStateByName</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#getCurrentMaskData#~getCurrentMaskData">getCurrentMaskData</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#getToolState#~getToolState">getToolState</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#isToolMissing#~isToolMissing">isToolMissing</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#setSegmentationConfig#~setSegmentationConfig">setSegmentationConfig</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#setToolActive#~setToolActive">setToolActive</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#setToolActive#~setToolActive">setToolActive</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#setToolEnabled#~setToolEnabled">setToolEnabled</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#setToolPassive#~setToolPassive">setToolPassive</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#syncToolStack#~syncToolStack">syncToolStack</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#updateDiameterTool#~updateDiameterTool">updateDiameterTool</a></li><li data-type='method' style='display: none;'><a href="module-imaging_tools.html#updateStackToolState#~updateStackToolState">updateStackToolState</a></li></ul></li><li><a href="module-imaging_utils.html">imaging/utils</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#formatDate#formatDate">formatDate</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#formatDateTime#formatDateTime">formatDateTime</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getCmprMetadata#getCmprMetadata">getCmprMetadata</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getDICOMTag#getDICOMTag">getDICOMTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getDICOMTagCode#getDICOMTagCode">getDICOMTagCode</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getDistanceBetweenSlices#getDistanceBetweenSlices">getDistanceBetweenSlices</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getMaxPixelValue#getMaxPixelValue">getMaxPixelValue</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getMeanValue#getMeanValue">getMeanValue</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getMinPixelValue#getMinPixelValue">getMinPixelValue</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getNormalOrientation#getNormalOrientation">getNormalOrientation</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getPixelRepresentation#getPixelRepresentation">getPixelRepresentation</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getPixelTypedArray#getPixelTypedArray">getPixelTypedArray</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getReslicedIOP#getReslicedIOP">getReslicedIOP</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getReslicedIPP#getReslicedIPP">getReslicedIPP</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getReslicedMetadata#getReslicedMetadata">getReslicedMetadata</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getReslicedPixeldata#getReslicedPixeldata">getReslicedPixeldata</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getReslicedSliceLocation#getReslicedSliceLocation">getReslicedSliceLocation</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getSortedStack#getSortedStack">getSortedStack</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getSortedUIDs#getSortedUIDs">getSortedUIDs</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getTagValue#getTagValue">getTagValue</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getTypedArray#getTypedArray">getTypedArray</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#getTypedArrayFromDataType#getTypedArrayFromDataType">getTypedArrayFromDataType</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#isElement#isElement">isElement</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#isNegativeSign#isNegativeSign">isNegativeSign</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#isStringVr#isStringVr">isStringVr</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#isValidDate#isValidDate">isValidDate</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseAgeTag#parseAgeTag">parseAgeTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseDateTag#parseDateTag">parseDateTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseDateTimeTag#parseDateTimeTag">parseDateTimeTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseDICOMFileIDTag#parseDICOMFileIDTag">parseDICOMFileIDTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parsePatientNameTag#parsePatientNameTag">parsePatientNameTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseTag#parseTag">parseTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#parseTimeTag#parseTimeTag">parseTimeTag</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#permuteSignedArrays#permuteSignedArrays">permuteSignedArrays</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#permuteValues#permuteValues">permuteValues</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#rand#rand">rand</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#randomId#randomId">randomId</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#sortStackCallback#sortStackCallback">sortStackCallback</a></li><li data-type='method' style='display: none;'><a href="module-imaging_utils.html#spacingArray#spacingArray">spacingArray</a></li></ul></li><li><a href="module-loaders_commonLoader.html">loaders/commonLoader</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#getImageFrame#getImageFrame">getImageFrame</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#getLarvitarImageTracker#getLarvitarImageTracker">getLarvitarImageTracker</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#getLarvitarManager#getLarvitarManager">getLarvitarManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#getSeriesDataFromLarvitarManager#getSeriesDataFromLarvitarManager">getSeriesDataFromLarvitarManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#populateLarvitarManager#populateLarvitarManager">populateLarvitarManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#removeSeriesFromLarvitarManager#removeSeriesFromLarvitarManager">removeSeriesFromLarvitarManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#resetLarvitarManager#resetLarvitarManager">resetLarvitarManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_commonLoader.html#updateLarvitarManager#updateLarvitarManager">updateLarvitarManager</a></li></ul></li><li><a href="module-loaders_dicomLoader.html">loaders/dicomLoader</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-loaders_dicomLoader.html#cacheImages#cacheImages">cacheImages</a></li><li data-type='method' style='display: none;'><a href="module-loaders_dicomLoader.html#getDicomImageId#getDicomImageId">getDicomImageId</a></li></ul></li><li><a href="module-loaders_fileLoader.html">loaders/fileLoader</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-loaders_fileLoader.html#getFileImageId#getFileImageId">getFileImageId</a></li><li data-type='method' style='display: none;'><a href="module-loaders_fileLoader.html#populateFileManager#populateFileManager">populateFileManager</a></li><li data-type='method' style='display: none;'><a href="module-loaders_fileLoader.html#resetFileLoader#resetFileLoader">resetFileLoader</a></li><li data-type='method' style='display: none;'><a href="module-loaders_fileLoader.html#resetFileManager#resetFileManager">resetFileManager</a></li></ul></li><li><a href="module-loaders_nrrdLoader.html">loaders/nrrdLoader</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#buildNrrdImage#buildNrrdImage">buildNrrdImage</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#createCustomImage#createCustomImage">createCustomImage</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#getImageIdFromSlice#getImageIdFromSlice">getImageIdFromSlice</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#getNrrdImageId#getNrrdImageId">getNrrdImageId</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#getNrrdSerieDimensions#getNrrdSerieDimensions">getNrrdSerieDimensions</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#getSliceNumberFromImageId#getSliceNumberFromImageId">getSliceNumberFromImageId</a></li><li data-type='method' style='display: none;'><a href="module-loaders_nrrdLoader.html#loadNrrdImage#loadNrrdImage">loadNrrdImage</a></li></ul></li><li><a href="module-loaders_resliceLoader.html">loaders/resliceLoader</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-loaders_resliceLoader.html#createCustomImage#createCustomImage">createCustomImage</a></li><li data-type='method' style='display: none;'><a href="module-loaders_resliceLoader.html#loadReslicedImage#loadReslicedImage">loadReslicedImage</a></li></ul></li><li><a href="module-monitors_memory.html">monitors/memory</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#checkMemoryAllocation#checkMemoryAllocation">checkMemoryAllocation</a></li><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#checkMemorySupport#checkMemorySupport">checkMemorySupport</a></li><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#getAvailableMemory#getAvailableMemory">getAvailableMemory</a></li><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#getMB#getMB">getMB</a></li><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#getUsedMemory#getUsedMemory">getUsedMemory</a></li><li data-type='method' style='display: none;'><a href="module-monitors_memory.html#setAvailableMemory#setAvailableMemory">setAvailableMemory</a></li></ul></li><li><a href="module-tools_default.html">tools/default</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-tools_default.html#getDefaultToolsByType#~getDefaultToolsByType">getDefaultToolsByType</a></li><li data-type='method' style='display: none;'><a href="module-tools_default.html#setDefaultToolsProps#~setDefaultToolsProps">setDefaultToolsProps</a></li></ul></li></ul><h3>Events</h3><ul><li><a href="ContoursTool.html#event:_drawingDoubleTapClickCallback">ContoursTool#_drawingDoubleTapClickCallback</a></li><li><a href="ContoursTool.html#event:_drawingMouseDoubleClickCallback">ContoursTool#_drawingMouseDoubleClickCallback</a></li><li><a href="ContoursTool.html#event:_drawingMouseDownCallback">ContoursTool#_drawingMouseDownCallback</a></li><li><a href="ContoursTool.html#event:_drawingMouseDragCallback">ContoursTool#_drawingMouseDragCallback</a></li><li><a href="ContoursTool.html#event:_drawingMouseMoveCallback">ContoursTool#_drawingMouseMoveCallback</a></li><li><a href="ContoursTool.html#event:_drawingMouseUpCallback">ContoursTool#_drawingMouseUpCallback</a></li><li><a href="ContoursTool.html#event:_drawingTouchDragCallback">ContoursTool#_drawingTouchDragCallback</a></li><li><a href="ContoursTool.html#event:_drawingTouchStartCallback">ContoursTool#_drawingTouchStartCallback</a></li><li><a href="ContoursTool.html#event:_editMouseDragCallback">ContoursTool#_editMouseDragCallback</a></li><li><a href="ContoursTool.html#event:_editTouchDragCallback">ContoursTool#_editTouchDragCallback</a></li></ul><h3>Mixins</h3><ul><li><a href="Mixins.polygonSegmentationMixin%2520-%2520segmentation%2520operations%2520for%2520polyline.html">Mixins.polygonSegmentationMixin - segmentation operations for polyline</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_checkIfDrawing">_checkIfDrawing</a></li><li><a href="global.html#_paint">_paint</a></li><li><a href="global.html#addDefaultTools">addDefaultTools</a></li><li><a href="global.html#addMouseKeyHandlers">addMouseKeyHandlers</a></li><li><a href="global.html#addSegmentationMask">addSegmentationMask</a></li><li><a href="global.html#addTool">addTool</a></li><li><a href="global.html#buildMultiFrameImage">buildMultiFrameImage</a></li><li><a href="global.html">clearMultiFrameCache</a></li><li><a href="global.html#clearSegmentationState">clearSegmentationState</a></li><li><a href="global.html#config">config</a></li><li><a href="global.html">createCustomImage</a></li><li><a href="global.html#csToolsCreateStack">csToolsCreateStack</a></li><li><a href="global.html#csToolsUpdateImageIndex">csToolsUpdateImageIndex</a></li><li><a href="global.html#deleteMask">deleteMask</a></li><li><a href="global.html#disableBrushTool">disableBrushTool</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#enableBrushTool">enableBrushTool</a></li><li><a href="global.html#eraseFreehand">eraseFreehand</a></li><li><a href="global.html#eraseInsideFreehand">eraseInsideFreehand</a></li><li><a href="global.html#eraseOutsideFreehand">eraseOutsideFreehand</a></li><li><a href="global.html#exportAnnotations">exportAnnotations</a></li><li><a href="global.html#extractToolInfo">extractToolInfo</a></li><li><a href="global.html#fillFreehand">fillFreehand</a></li><li><a href="global.html#fillInsideFreehand">fillInsideFreehand</a></li><li><a href="global.html#fillOutsideFreehand">fillOutsideFreehand</a></li><li><a href="global.html#forceRender">forceRender</a></li><li><a href="global.html#generateCSV">generateCSV</a></li><li><a href="global.html#generateLUT">generateLUT</a></li><li><a href="global.html#generateUniformLUT">generateUniformLUT</a></li><li><a href="global.html#getActiveLabelmapBuffer">getActiveLabelmapBuffer</a></li><li><a href="global.html#getCircleWithThreshold">getCircleWithThreshold</a></li><li><a href="global.html">getMultiFrameImageId</a></li><li><a href="global.html#HSVtoRGB">HSVtoRGB</a></li><li><a href="global.html#initializeCSTools">initializeCSTools</a></li><li><a href="global.html#initSegmentationModule">initSegmentationModule</a></li><li><a href="global.html#isDrawing">isDrawing</a></li><li><a href="global.html#isToolMissing">isToolMissing</a></li><li><a href="global.html#loadAnnotations">loadAnnotations</a></li><li><a href="global.html#loadMultiFrameImage">loadMultiFrameImage</a></li><li><a href="global.html#NRRD_TYPES_TO_TYPEDARRAY">NRRD_TYPES_TO_TYPEDARRAY</a></li><li><a href="global.html">parse</a></li><li><a href="global.html#redoLastStroke">redoLastStroke</a></li><li><a href="global.html#renderToolData">renderToolData</a></li><li><a href="global.html#restoreToolState">restoreToolState</a></li><li><a href="global.html#saveAnnotations">saveAnnotations</a></li><li><a href="global.html#saveToolState">saveToolState</a></li><li><a href="global.html#setActiveLabelmap">setActiveLabelmap</a></li><li><a href="global.html#setActiveLabelOpacity">setActiveLabelOpacity</a></li><li><a href="global.html#setActiveSegment">setActiveSegment</a></li><li><a href="global.html#setBrushProps">setBrushProps</a></li><li><a href="global.html#setInactiveLabelOpacity">setInactiveLabelOpacity</a></li><li><a href="global.html#setMaskProps">setMaskProps</a></li><li><a href="global.html">setPixelDataType</a></li><li><a href="global.html#setToolActive">setToolActive</a></li><li><a href="global.html#setToolDisabled">setToolDisabled</a></li><li><a href="global.html#setToolEnabled">setToolEnabled</a></li><li><a href="global.html#setToolPassive">setToolPassive</a></li><li><a href="global.html#setToolsStyle">setToolsStyle</a></li><li><a href="global.html#toggleContourMode">toggleContourMode</a></li><li><a href="global.html">toggleMouseHandlers</a></li><li><a href="global.html#tryUpdateImage">tryUpdateImage</a></li><li><a href="global.html#undoLastStroke">undoLastStroke</a></li></ul>
|
|
41
|
-
|
|
42
|
-
</nav>
|
|
43
|
-
|
|
44
|
-
<div id="main">
|
|
45
|
-
|
|
46
|
-
<h1 class="page-title">image_rendering.js</h1>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<section>
|
|
55
|
-
<article>
|
|
56
|
-
<pre class="prettyprint source linenums"><code>/** @module imaging/rendering
|
|
57
|
-
* @desc This file provides functionalities for
|
|
58
|
-
* rendering images in html canvas using cornerstone
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
// external libraries
|
|
62
|
-
import cornerstone from "cornerstone-core";
|
|
63
|
-
import cornerstoneWADOImageLoader from "cornerstone-wado-image-loader";
|
|
64
|
-
import { each, has } from "lodash";
|
|
65
|
-
|
|
66
|
-
// internal libraries
|
|
67
|
-
import { getFileImageId } from "./loaders/fileLoader";
|
|
68
|
-
import { csToolsCreateStack } from "./tools/tools.main";
|
|
69
|
-
import { toggleMouseToolsListeners } from "./tools/tools.interaction";
|
|
70
|
-
import { larvitar_store } from "./image_store";
|
|
71
|
-
import { applyColorMap } from "./image_colormaps";
|
|
72
|
-
import { isElement } from "./image_utils";
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
* This module provides the following functions to be exported:
|
|
76
|
-
* clearImageCache(seriesId)
|
|
77
|
-
* loadAndCacheImages(seriesData, callback)
|
|
78
|
-
* renderFileImage(file, elementId)
|
|
79
|
-
* renderWebImage(url, elementId)
|
|
80
|
-
* disableViewport(elementId)
|
|
81
|
-
* unloadViewport(elementId, seriesId)
|
|
82
|
-
* resizeViewport(elementId)
|
|
83
|
-
* renderImage(series, elementId, defaultProps)
|
|
84
|
-
* updateImage(series, elementId, imageIndex)
|
|
85
|
-
* resetViewports([elementIds])
|
|
86
|
-
* updateViewportData(elementId)
|
|
87
|
-
* toggleMouseHandlers(elementId, disableFlag)
|
|
88
|
-
* storeViewportData(params...)
|
|
89
|
-
* invertImage(elementId)
|
|
90
|
-
* flipImageHorizontal(elementId)
|
|
91
|
-
* flipImageVertical(elementId)
|
|
92
|
-
* rotateImageLeft(elementId)
|
|
93
|
-
* rotateImageRight(elementId)
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Purge the cornestone internal cache
|
|
98
|
-
* If seriesId is passed as argument only imageIds of the series are purged from internal cache
|
|
99
|
-
* @instance
|
|
100
|
-
* @function clearImageCache
|
|
101
|
-
* @param {String} seriesId - The id of the serie
|
|
102
|
-
*/
|
|
103
|
-
export const clearImageCache = function (seriesId) {
|
|
104
|
-
if (seriesId) {
|
|
105
|
-
let series = larvitar_store.get("series");
|
|
106
|
-
if (has(series, seriesId)) {
|
|
107
|
-
each(series[seriesId].imageIds, function (imageId) {
|
|
108
|
-
if (cornerstone.imageCache.cachedImages.length > 0) {
|
|
109
|
-
try {
|
|
110
|
-
cornerstone.imageCache.removeImageLoadObject(imageId);
|
|
111
|
-
} catch (e) {
|
|
112
|
-
console.warn("no cached image");
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
let uri =
|
|
116
|
-
cornerstoneWADOImageLoader.wadouri.parseImageId(imageId).url;
|
|
117
|
-
cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.unload(uri);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
larvitar_store.removeSeriesIds(seriesId);
|
|
122
|
-
console.log("Uncached images for ", seriesId);
|
|
123
|
-
}
|
|
124
|
-
} else {
|
|
125
|
-
cornerstone.imageCache.purgeCache();
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Load and cache all serie's images
|
|
131
|
-
* Add series's imageIds into store
|
|
132
|
-
* @instance
|
|
133
|
-
* @function loadAndCacheImages
|
|
134
|
-
* @param {Object} series the parsed series data
|
|
135
|
-
* @param {Function} callback a callback function
|
|
136
|
-
*/
|
|
137
|
-
export function loadAndCacheImages(series, callback) {
|
|
138
|
-
let t0 = performance.now();
|
|
139
|
-
let cachingCounter = 0;
|
|
140
|
-
if (series.isMultiframe) {
|
|
141
|
-
// console.warn("Do not cache multiframe images for performance issues");
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
let response = {
|
|
145
|
-
seriesId: series.seriesUID,
|
|
146
|
-
loading: 0,
|
|
147
|
-
series: {}
|
|
148
|
-
};
|
|
149
|
-
callback(response);
|
|
150
|
-
// add serie's imageIds into store
|
|
151
|
-
larvitar_store.addSeriesIds(series.seriesUID, series.imageIds);
|
|
152
|
-
// add serie's caching progress into store
|
|
153
|
-
larvitar_store.set("progress", [series.seriesUID, 0]);
|
|
154
|
-
each(series.imageIds, function (imageId) {
|
|
155
|
-
cornerstone.loadAndCacheImage(imageId).then(function () {
|
|
156
|
-
cachingCounter += 1;
|
|
157
|
-
let cachingPercentage = Math.floor(
|
|
158
|
-
(cachingCounter / series.imageIds.length) * 100
|
|
159
|
-
);
|
|
160
|
-
response.loading = cachingPercentage;
|
|
161
|
-
larvitar_store.set("progress", [series.seriesUID, cachingPercentage]);
|
|
162
|
-
if (cachingCounter == series.imageIds.length) {
|
|
163
|
-
let t1 = performance.now();
|
|
164
|
-
console.log(`Call to cacheImages took ${t1 - t0} milliseconds.`);
|
|
165
|
-
console.log("Cached images for ", series.seriesUID);
|
|
166
|
-
response.series = series;
|
|
167
|
-
}
|
|
168
|
-
callback(response);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Render an image (png or jpg) from File on a html div using cornerstone
|
|
175
|
-
* @instance
|
|
176
|
-
* @function renderWebImage
|
|
177
|
-
* @param {Object} file - The image File object
|
|
178
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
179
|
-
* @param {Function} callback - Optional callback function with image object
|
|
180
|
-
*/
|
|
181
|
-
export const renderFileImage = function (file, elementId, callback) {
|
|
182
|
-
let element = isElement(elementId)
|
|
183
|
-
? elementId
|
|
184
|
-
: document.getElementById(elementId);
|
|
185
|
-
if (!element) {
|
|
186
|
-
console.error("invalid html element: " + elementId);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (cornerstone.getEnabledElements().length == 0) {
|
|
191
|
-
cornerstone.enable(element);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// check if imageId is already stored in fileManager
|
|
195
|
-
const imageId = getFileImageId(file);
|
|
196
|
-
if (imageId) {
|
|
197
|
-
cornerstone.loadImage(imageId).then(function (image) {
|
|
198
|
-
cornerstone.displayImage(element, image);
|
|
199
|
-
let viewport = cornerstone.getViewport(element);
|
|
200
|
-
viewport.displayedArea.brhc.x = image.width;
|
|
201
|
-
viewport.displayedArea.brhc.y = image.height;
|
|
202
|
-
cornerstone.setViewport(element, viewport);
|
|
203
|
-
cornerstone.fitToWindow(element);
|
|
204
|
-
|
|
205
|
-
csToolsCreateStack(element);
|
|
206
|
-
if (callback) {
|
|
207
|
-
callback(image);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Render an image (png or jpg) from web url on a html div using cornerstone
|
|
215
|
-
* @instance
|
|
216
|
-
* @function renderWebImage
|
|
217
|
-
* @param {String} url - The image data url
|
|
218
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
219
|
-
*/
|
|
220
|
-
export const renderWebImage = function (url, elementId) {
|
|
221
|
-
let element = isElement(elementId)
|
|
222
|
-
? elementId
|
|
223
|
-
: document.getElementById(elementId);
|
|
224
|
-
if (!element) {
|
|
225
|
-
console.error("invalid html element: " + elementId);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
cornerstone.enable(element);
|
|
230
|
-
cornerstone.loadImage(url).then(function (image) {
|
|
231
|
-
cornerstone.displayImage(element, image);
|
|
232
|
-
csToolsCreateStack(element);
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Unrender an image on a html div using cornerstone
|
|
238
|
-
* @instance
|
|
239
|
-
* @function disableViewport
|
|
240
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
241
|
-
*/
|
|
242
|
-
export const disableViewport = function (elementId) {
|
|
243
|
-
let element = isElement(elementId)
|
|
244
|
-
? elementId
|
|
245
|
-
: document.getElementById(elementId);
|
|
246
|
-
if (!element) {
|
|
247
|
-
console.error("invalid html element: " + elementId);
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
// toggleMouseHandlers(elementId, true); // flagged true to disable handlers
|
|
251
|
-
toggleMouseToolsListeners(elementId, true);
|
|
252
|
-
cornerstone.disable(element);
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Unrender an image on a html div using cornerstone
|
|
257
|
-
* Remove image from cornerstone cache and remove from store
|
|
258
|
-
* @instance
|
|
259
|
-
* @function unloadViewport
|
|
260
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
261
|
-
* @param {String} seriesId - The id of the serie
|
|
262
|
-
*/
|
|
263
|
-
export const unloadViewport = function (elementId, seriesId) {
|
|
264
|
-
disableViewport(elementId);
|
|
265
|
-
|
|
266
|
-
if (!seriesId) {
|
|
267
|
-
console.warn(
|
|
268
|
-
"seriesId not provided, use disableViewport if you do not want to uncache images"
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
// remove images from cornerstone cache
|
|
272
|
-
if (seriesId && has(larvitar_store.get("series"), seriesId)) {
|
|
273
|
-
clearImageCache(seriesId);
|
|
274
|
-
}
|
|
275
|
-
larvitar_store.deleteViewport(elementId);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Resize a viewport using cornerstone resize
|
|
280
|
-
* And forcing fit to window
|
|
281
|
-
* @instance
|
|
282
|
-
* @function resizeViewport
|
|
283
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
284
|
-
*/
|
|
285
|
-
export const resizeViewport = function (elementId) {
|
|
286
|
-
let element = isElement(elementId)
|
|
287
|
-
? elementId
|
|
288
|
-
: document.getElementById(elementId);
|
|
289
|
-
if (!element) {
|
|
290
|
-
console.error("invalid html element: " + elementId);
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
cornerstone.resize(element, true); // true flag forces fitToWindow
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Cache image and render it in a html div using cornerstone
|
|
298
|
-
* @instance
|
|
299
|
-
* @function renderImage
|
|
300
|
-
* @param {Object} seriesStack - The original series data object
|
|
301
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
302
|
-
* @param {Object} defaultProps - Optional default props
|
|
303
|
-
* @return {Promise} Return a promise when the image has been rendered succesfully
|
|
304
|
-
*/
|
|
305
|
-
export const renderImage = function (seriesStack, elementId, defaultProps) {
|
|
306
|
-
let t0 = performance.now();
|
|
307
|
-
|
|
308
|
-
// get element and enable it
|
|
309
|
-
let element = isElement(elementId)
|
|
310
|
-
? elementId
|
|
311
|
-
: document.getElementById(elementId);
|
|
312
|
-
if (!element) {
|
|
313
|
-
console.error("invalid html element: " + elementId);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
cornerstone.enable(element);
|
|
317
|
-
|
|
318
|
-
let series = { ...seriesStack };
|
|
319
|
-
|
|
320
|
-
// default to 0 if multiframe and frameId is null
|
|
321
|
-
// let frameId = series.isMultiframe ? 1 : null;
|
|
322
|
-
|
|
323
|
-
larvitar_store.set("renderingStatus", [elementId, false]);
|
|
324
|
-
let data = getSeriesData(series, defaultProps);
|
|
325
|
-
if (!data.imageId) {
|
|
326
|
-
console.warn("Error during renderImage: imageId has not been loaded yet.");
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
let renderPromise = new Promise(resolve => {
|
|
331
|
-
// load and display one image (imageId)
|
|
332
|
-
cornerstone.loadImage(data.imageId).then(function (image) {
|
|
333
|
-
cornerstone.displayImage(element, image);
|
|
334
|
-
|
|
335
|
-
if (series.layer) {
|
|
336
|
-
// assign the image to its layer and return its id
|
|
337
|
-
series.layer.id = cornerstone.addLayer(
|
|
338
|
-
element,
|
|
339
|
-
image,
|
|
340
|
-
series.layer.options
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
let viewport = cornerstone.getViewport(element);
|
|
345
|
-
|
|
346
|
-
// window width and window level
|
|
347
|
-
// are stored in specific dicom tags
|
|
348
|
-
// (x00281050 and x00281051)
|
|
349
|
-
// if not present check in image object
|
|
350
|
-
data.ww = data.ww ? data.ww : image.windowWidth;
|
|
351
|
-
data.wc = data.wc ? data.wc : image.windowCenter;
|
|
352
|
-
data.defaultWW = data.defaultWW ? data.defaultWW : data.ww;
|
|
353
|
-
data.defaultWC = data.defaultWC ? data.defaultWC : data.wc;
|
|
354
|
-
|
|
355
|
-
cornerstone.fitToWindow(element);
|
|
356
|
-
|
|
357
|
-
if (defaultProps && has(defaultProps, "scale")) {
|
|
358
|
-
viewport.scale = defaultProps["scale"];
|
|
359
|
-
cornerstone.setViewport(element, viewport);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (
|
|
363
|
-
defaultProps &&
|
|
364
|
-
has(defaultProps, "tr_x") &&
|
|
365
|
-
has(defaultProps, "tr_y")
|
|
366
|
-
) {
|
|
367
|
-
viewport.translation.x = defaultProps["tr_x"];
|
|
368
|
-
viewport.translation.y = defaultProps["tr_y"];
|
|
369
|
-
cornerstone.setViewport(element, viewport);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// color maps
|
|
373
|
-
if (
|
|
374
|
-
defaultProps &&
|
|
375
|
-
has(defaultProps, "colormap") &&
|
|
376
|
-
image.color == false
|
|
377
|
-
) {
|
|
378
|
-
applyColorMap(defaultProps["colormap"]);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
let storedViewport = cornerstone.getViewport(element);
|
|
382
|
-
storeViewportData(
|
|
383
|
-
image,
|
|
384
|
-
elementId,
|
|
385
|
-
data.imageIndex,
|
|
386
|
-
data.numberOfSlices,
|
|
387
|
-
data.rows,
|
|
388
|
-
data.cols,
|
|
389
|
-
data.spacing_x,
|
|
390
|
-
data.spacing_y,
|
|
391
|
-
data.thickness,
|
|
392
|
-
storedViewport,
|
|
393
|
-
data.defaultWW,
|
|
394
|
-
data.defaultWC
|
|
395
|
-
);
|
|
396
|
-
larvitar_store.set("renderingStatus", [elementId, true]);
|
|
397
|
-
let t1 = performance.now();
|
|
398
|
-
console.log(`Call to renderImage took ${t1 - t0} milliseconds.`);
|
|
399
|
-
|
|
400
|
-
let uri = cornerstoneWADOImageLoader.wadouri.parseImageId(
|
|
401
|
-
data.imageId
|
|
402
|
-
).url;
|
|
403
|
-
cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.unload(uri);
|
|
404
|
-
image = null;
|
|
405
|
-
series = null;
|
|
406
|
-
data = null;
|
|
407
|
-
resolve();
|
|
408
|
-
});
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
csToolsCreateStack(element, series.imageIds, data.imageIndex - 1);
|
|
412
|
-
toggleMouseToolsListeners(elementId);
|
|
413
|
-
|
|
414
|
-
return renderPromise;
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Update the cornerstone image with new imageIndex
|
|
419
|
-
* @instance
|
|
420
|
-
* @function updateImage
|
|
421
|
-
* @param {Object} series - The original series data object
|
|
422
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
423
|
-
* @param {Number} imageIndex - The index of the image to be rendered
|
|
424
|
-
* @param {Boolean} cacheImage - A flag to handle image cache
|
|
425
|
-
*/
|
|
426
|
-
export const updateImage = function (
|
|
427
|
-
series,
|
|
428
|
-
elementId,
|
|
429
|
-
imageIndex,
|
|
430
|
-
cacheImage
|
|
431
|
-
) {
|
|
432
|
-
let element = isElement(elementId)
|
|
433
|
-
? elementId
|
|
434
|
-
: document.getElementById(elementId);
|
|
435
|
-
if (!element) {
|
|
436
|
-
console.log("not element");
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
let index = imageIndex == 0 ? imageIndex : imageIndex - 1;
|
|
440
|
-
if (cacheImage) {
|
|
441
|
-
cornerstone
|
|
442
|
-
.loadAndCacheImage(series.imageIds[index])
|
|
443
|
-
.then(function (image) {
|
|
444
|
-
cornerstone.displayImage(element, image);
|
|
445
|
-
});
|
|
446
|
-
} else {
|
|
447
|
-
cornerstone.loadImage(series.imageIds[index]).then(function (image) {
|
|
448
|
-
cornerstone.displayImage(element, image);
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Reset viewport values (scale, translation and wwwc)
|
|
455
|
-
* @instance
|
|
456
|
-
* @function resetViewports
|
|
457
|
-
* @param {Array} elementIds - The array of hmtl div ids
|
|
458
|
-
*/
|
|
459
|
-
export const resetViewports = function (elementIds) {
|
|
460
|
-
each(elementIds, function (elementId) {
|
|
461
|
-
let element = document.getElementById(elementId);
|
|
462
|
-
if (!element) {
|
|
463
|
-
console.error("invalid html element: " + elementId);
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
let viewport = cornerstone.getViewport(element);
|
|
467
|
-
viewport.scale = larvitar_store.get(
|
|
468
|
-
"viewports",
|
|
469
|
-
elementId,
|
|
470
|
-
"default",
|
|
471
|
-
"scale"
|
|
472
|
-
);
|
|
473
|
-
|
|
474
|
-
viewport.rotation = larvitar_store.get(
|
|
475
|
-
"viewports",
|
|
476
|
-
elementId,
|
|
477
|
-
"default",
|
|
478
|
-
"rotation"
|
|
479
|
-
);
|
|
480
|
-
viewport.translation.x = larvitar_store.get(
|
|
481
|
-
"viewports",
|
|
482
|
-
elementId,
|
|
483
|
-
"default",
|
|
484
|
-
"translation",
|
|
485
|
-
"x"
|
|
486
|
-
);
|
|
487
|
-
viewport.translation.y = larvitar_store.get(
|
|
488
|
-
"viewports",
|
|
489
|
-
elementId,
|
|
490
|
-
"default",
|
|
491
|
-
"translation",
|
|
492
|
-
"y"
|
|
493
|
-
);
|
|
494
|
-
viewport.voi.windowWidth = larvitar_store.get(
|
|
495
|
-
"viewports",
|
|
496
|
-
elementId,
|
|
497
|
-
"default",
|
|
498
|
-
"voi",
|
|
499
|
-
"windowWidth"
|
|
500
|
-
);
|
|
501
|
-
viewport.voi.windowCenter = larvitar_store.get(
|
|
502
|
-
"viewports",
|
|
503
|
-
elementId,
|
|
504
|
-
"default",
|
|
505
|
-
"voi",
|
|
506
|
-
"windowCenter"
|
|
507
|
-
);
|
|
508
|
-
|
|
509
|
-
viewport.hflip = false;
|
|
510
|
-
viewport.vflip = false;
|
|
511
|
-
viewport.invert = false;
|
|
512
|
-
|
|
513
|
-
cornerstone.setViewport(element, viewport);
|
|
514
|
-
cornerstone.fitToWindow(element);
|
|
515
|
-
cornerstone.updateImage(element);
|
|
516
|
-
|
|
517
|
-
larvitar_store.set("scale", [elementId, viewport.scale]);
|
|
518
|
-
larvitar_store.set("rotation", [elementId, viewport.rotation]);
|
|
519
|
-
larvitar_store.set("translation", [
|
|
520
|
-
elementId,
|
|
521
|
-
viewport.translation.x,
|
|
522
|
-
viewport.translation.y
|
|
523
|
-
]);
|
|
524
|
-
larvitar_store.set("contrast", [
|
|
525
|
-
elementId,
|
|
526
|
-
viewport.voi.windowWidth,
|
|
527
|
-
viewport.voi.windowCenter
|
|
528
|
-
]);
|
|
529
|
-
});
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* Update viewport data in store
|
|
534
|
-
* @instance
|
|
535
|
-
* @function updateViewportData
|
|
536
|
-
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
537
|
-
* @param {Object} viewportData - The new viewport data
|
|
538
|
-
*/
|
|
539
|
-
export const updateViewportData = function (
|
|
540
|
-
elementId,
|
|
541
|
-
viewportData,
|
|
542
|
-
activeTool
|
|
543
|
-
) {
|
|
544
|
-
let element = isElement(elementId)
|
|
545
|
-
? elementId
|
|
546
|
-
: document.getElementById(elementId);
|
|
547
|
-
if (!element) {
|
|
548
|
-
console.error("invalid html element: " + elementId);
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
switch (activeTool) {
|
|
552
|
-
case "Wwwc":
|
|
553
|
-
case "WwwcRegion":
|
|
554
|
-
// sync viewports if needed
|
|
555
|
-
let elements = cornerstone.getEnabledElements();
|
|
556
|
-
each(elements, function (el) {
|
|
557
|
-
larvitar_store.set("contrast", [
|
|
558
|
-
el.element.id,
|
|
559
|
-
viewportData.voi.windowWidth,
|
|
560
|
-
viewportData.voi.windowCenter
|
|
561
|
-
]);
|
|
562
|
-
});
|
|
563
|
-
break;
|
|
564
|
-
case "Pan":
|
|
565
|
-
larvitar_store.set("translation", [
|
|
566
|
-
elementId,
|
|
567
|
-
viewportData.translation.x,
|
|
568
|
-
viewportData.translation.y
|
|
569
|
-
]);
|
|
570
|
-
break;
|
|
571
|
-
case "Zoom":
|
|
572
|
-
larvitar_store.set("scale", [elementId, viewportData.scale]);
|
|
573
|
-
break;
|
|
574
|
-
case "Rotate":
|
|
575
|
-
larvitar_store.set("rotation", [elementId, viewportData.rotation]);
|
|
576
|
-
break;
|
|
577
|
-
default:
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Store the viewport data into internal storage
|
|
584
|
-
* @instance
|
|
585
|
-
* @function storeViewportData
|
|
586
|
-
* @param {Object} image - The cornerstone image frame
|
|
587
|
-
* @param {String} elementId - The html div id used for rendering
|
|
588
|
-
* @param {Number} imageIndex - The index of the image
|
|
589
|
-
* @param {Number} numberOfSlices - The number of slices of the series
|
|
590
|
-
* @param {Number} rows - The number of rows of the image
|
|
591
|
-
* @param {Number} cols - The number of columns of the image
|
|
592
|
-
* @param {Number} spacing_x - The spacing value for x axis
|
|
593
|
-
* @param {Number} spacing_y - The spacing value for y direction
|
|
594
|
-
* @param {Number} thickness - The thickness value between slices
|
|
595
|
-
* @param {String} viewport - The viewport tag name
|
|
596
|
-
* @param {Number} defaultWW - The default WW value
|
|
597
|
-
* @param {Number} defaultWC - The default WC value
|
|
598
|
-
*/
|
|
599
|
-
export const storeViewportData = function (
|
|
600
|
-
image,
|
|
601
|
-
elementId,
|
|
602
|
-
imageIndex,
|
|
603
|
-
numberOfSlices,
|
|
604
|
-
rows,
|
|
605
|
-
cols,
|
|
606
|
-
spacing_x,
|
|
607
|
-
spacing_y,
|
|
608
|
-
thickness,
|
|
609
|
-
viewport,
|
|
610
|
-
defaultWW,
|
|
611
|
-
defaultWC
|
|
612
|
-
) {
|
|
613
|
-
larvitar_store.set("dimensions", [elementId, rows, cols]);
|
|
614
|
-
larvitar_store.set("spacing", [elementId, spacing_x, spacing_y]);
|
|
615
|
-
larvitar_store.set("thickness", [elementId, thickness]);
|
|
616
|
-
larvitar_store.set("minPixelValue", [elementId, image.minPixelValue]);
|
|
617
|
-
larvitar_store.set("maxPixelValue", [elementId, image.maxPixelValue]);
|
|
618
|
-
larvitar_store.set("minSliceId", [elementId, 1]);
|
|
619
|
-
larvitar_store.set("sliceId", [elementId, imageIndex]);
|
|
620
|
-
larvitar_store.set("maxSliceId", [elementId, numberOfSlices]);
|
|
621
|
-
larvitar_store.set("defaultViewport", [
|
|
622
|
-
elementId,
|
|
623
|
-
viewport.scale,
|
|
624
|
-
viewport.rotation,
|
|
625
|
-
viewport.translation.x,
|
|
626
|
-
viewport.translation.y,
|
|
627
|
-
defaultWW,
|
|
628
|
-
defaultWC
|
|
629
|
-
]);
|
|
630
|
-
larvitar_store.set("scale", [elementId, viewport.scale]);
|
|
631
|
-
larvitar_store.set("rotation", [elementId, viewport.rotation]);
|
|
632
|
-
larvitar_store.set("translation", [
|
|
633
|
-
elementId,
|
|
634
|
-
viewport.translation.x,
|
|
635
|
-
viewport.translation.y
|
|
636
|
-
]);
|
|
637
|
-
larvitar_store.set("contrast", [
|
|
638
|
-
elementId,
|
|
639
|
-
viewport.voi.windowWidth,
|
|
640
|
-
viewport.voi.windowCenter
|
|
641
|
-
]);
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Invert pixels of an image
|
|
646
|
-
* @instance
|
|
647
|
-
* @function invertImage
|
|
648
|
-
* @param {Object} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
649
|
-
*/
|
|
650
|
-
export const invertImage = function (elementId) {
|
|
651
|
-
let element = isElement(elementId)
|
|
652
|
-
? elementId
|
|
653
|
-
: document.getElementById(elementId);
|
|
654
|
-
if (!element) {
|
|
655
|
-
console.error("invalid html element: " + elementId);
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
let viewport = cornerstone.getViewport(element);
|
|
659
|
-
viewport.invert = !viewport.invert;
|
|
660
|
-
cornerstone.setViewport(element, viewport);
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* Flip image around horizontal axis
|
|
665
|
-
* @instance
|
|
666
|
-
* @function flipImageHorizontal
|
|
667
|
-
* @param {Object} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
668
|
-
*/
|
|
669
|
-
export const flipImageHorizontal = function (elementId) {
|
|
670
|
-
let element = isElement(elementId)
|
|
671
|
-
? elementId
|
|
672
|
-
: document.getElementById(elementId);
|
|
673
|
-
if (!element) {
|
|
674
|
-
console.error("invalid html element: " + elementId);
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
let viewport = cornerstone.getViewport(element);
|
|
678
|
-
viewport.hflip = !viewport.hflip;
|
|
679
|
-
cornerstone.setViewport(element, viewport);
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Flip image around vertical axis
|
|
684
|
-
* @instance
|
|
685
|
-
* @function flipImageVertical
|
|
686
|
-
* @param {Object} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
687
|
-
*/
|
|
688
|
-
export const flipImageVertical = function (elementId) {
|
|
689
|
-
let element = isElement(elementId)
|
|
690
|
-
? elementId
|
|
691
|
-
: document.getElementById(elementId);
|
|
692
|
-
if (!element) {
|
|
693
|
-
console.error("invalid html element: " + elementId);
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
let viewport = cornerstone.getViewport(element);
|
|
697
|
-
viewport.vflip = !viewport.vflip;
|
|
698
|
-
cornerstone.setViewport(element, viewport);
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Rotate image by 90° in left direction
|
|
703
|
-
* @instance
|
|
704
|
-
* @function rotateImageLeft
|
|
705
|
-
* @param {Object} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
706
|
-
*/
|
|
707
|
-
export const rotateImageLeft = function (elementId) {
|
|
708
|
-
let element = isElement(elementId)
|
|
709
|
-
? elementId
|
|
710
|
-
: document.getElementById(elementId);
|
|
711
|
-
if (!element) {
|
|
712
|
-
console.error("invalid html element: " + elementId);
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
let viewport = cornerstone.getViewport(element);
|
|
716
|
-
viewport.rotation -= 90;
|
|
717
|
-
cornerstone.setViewport(element, viewport);
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* Rotate image by 90° in right direction
|
|
722
|
-
* @instance
|
|
723
|
-
* @function rotateImageRight
|
|
724
|
-
* @param {Object} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
725
|
-
*/
|
|
726
|
-
export const rotateImageRight = function (elementId) {
|
|
727
|
-
let element = isElement(elementId)
|
|
728
|
-
? elementId
|
|
729
|
-
: document.getElementById(elementId);
|
|
730
|
-
if (!element) {
|
|
731
|
-
console.error("invalid html element: " + elementId);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
let viewport = cornerstone.getViewport(element);
|
|
735
|
-
viewport.rotation += 90;
|
|
736
|
-
cornerstone.setViewport(element, viewport);
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
/* Internal module functions */
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* Get series metadata from default props and series' metadata
|
|
743
|
-
* @instance
|
|
744
|
-
* @function getSeriesData
|
|
745
|
-
* @param {Object} series - The parsed data series
|
|
746
|
-
* @param {Object} defaultProps - Optional default properties
|
|
747
|
-
* @return {Object} data - A data dictionary with parsed tags' values
|
|
748
|
-
*/
|
|
749
|
-
let getSeriesData = function (series, defaultProps) {
|
|
750
|
-
let data = {};
|
|
751
|
-
// image index
|
|
752
|
-
if (series.isMultiframe) {
|
|
753
|
-
data.numberOfSlices = series.imageIds.length;
|
|
754
|
-
data.imageIndex = 1;
|
|
755
|
-
data.imageId = series.imageIds[0];
|
|
756
|
-
} else {
|
|
757
|
-
data.numberOfSlices =
|
|
758
|
-
defaultProps && has(defaultProps, "numberOfSlices")
|
|
759
|
-
? defaultProps["numberOfSlices"]
|
|
760
|
-
: series.imageIds.length;
|
|
761
|
-
|
|
762
|
-
data.imageIndex =
|
|
763
|
-
defaultProps &&
|
|
764
|
-
has(defaultProps, "sliceNumber") &&
|
|
765
|
-
defaultProps["sliceNumber"] <= data.numberOfSlices
|
|
766
|
-
? defaultProps["sliceNumber"]
|
|
767
|
-
: Math.floor(data.numberOfSlices / 2);
|
|
768
|
-
|
|
769
|
-
data.imageId =
|
|
770
|
-
data.imageIndex > 0
|
|
771
|
-
? series.imageIds[data.imageIndex - 1]
|
|
772
|
-
: series.imageIds[0];
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// rows, cols and x y z spacing
|
|
776
|
-
data.rows = series.instances[series.imageIds[0]].metadata["x00280010"];
|
|
777
|
-
data.cols = series.instances[series.imageIds[0]].metadata["x00280011"];
|
|
778
|
-
data.thickness = series.instances[series.imageIds[0]].metadata["x00180050"];
|
|
779
|
-
data.spacing_x = series.instances[series.imageIds[0]].metadata["x00280030"]
|
|
780
|
-
? series.instances[series.imageIds[0]].metadata["x00280030"][0]
|
|
781
|
-
: null;
|
|
782
|
-
data.spacing_y = series.instances[series.imageIds[0]].metadata["x00280030"]
|
|
783
|
-
? series.instances[series.imageIds[0]].metadata["x00280030"][1]
|
|
784
|
-
: null;
|
|
785
|
-
|
|
786
|
-
// window center and window width
|
|
787
|
-
data.wc =
|
|
788
|
-
defaultProps && has(defaultProps, "wc")
|
|
789
|
-
? defaultProps["wc"]
|
|
790
|
-
: series.instances[series.imageIds[0]].metadata["x00281050"];
|
|
791
|
-
|
|
792
|
-
data.ww =
|
|
793
|
-
defaultProps && has(defaultProps, "ww")
|
|
794
|
-
? defaultProps["ww"]
|
|
795
|
-
: series.instances[series.imageIds[0]].metadata["x00281051"];
|
|
796
|
-
|
|
797
|
-
// default values for reset
|
|
798
|
-
data.defaultWW =
|
|
799
|
-
defaultProps && has(defaultProps, "defaultWW")
|
|
800
|
-
? defaultProps["defaultWW"]
|
|
801
|
-
: data.ww;
|
|
802
|
-
data.defaultWC =
|
|
803
|
-
defaultProps && has(defaultProps, "defaultWC")
|
|
804
|
-
? defaultProps["defaultWC"]
|
|
805
|
-
: data.wc;
|
|
806
|
-
|
|
807
|
-
if (data.rows == null || data.cols == null) {
|
|
808
|
-
console.error("invalid image metadata");
|
|
809
|
-
larvitar_store.set("errorLog", "Invalid Image Metadata");
|
|
810
|
-
return;
|
|
811
|
-
} else {
|
|
812
|
-
larvitar_store.set("errorLog", "");
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
return data;
|
|
816
|
-
};
|
|
817
|
-
</code></pre>
|
|
818
|
-
</article>
|
|
819
|
-
</section>
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
</div>
|
|
827
|
-
|
|
828
|
-
<br class="clear">
|
|
829
|
-
|
|
830
|
-
<footer>
|
|
831
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
832
|
-
</footer>
|
|
833
|
-
|
|
834
|
-
<script>prettyPrint();</script>
|
|
835
|
-
<script src="scripts/polyfill.js"></script>
|
|
836
|
-
<script src="scripts/linenumber.js"></script>
|
|
837
|
-
|
|
838
|
-
<script src="scripts/search.js" defer></script>
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
<script src="scripts/collapse.js" defer></script>
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
</body>
|
|
845
|
-
</html>
|