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
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="h-100 overflow-hidden">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css"
|
|
7
|
+
rel="stylesheet"
|
|
8
|
+
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl"
|
|
9
|
+
crossorigin="anonymous"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
rel="stylesheet"
|
|
13
|
+
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/vs2015.min.css"
|
|
14
|
+
/>
|
|
15
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
|
|
16
|
+
<script>
|
|
17
|
+
hljs.highlightAll();
|
|
18
|
+
</script>
|
|
19
|
+
<title>Larvitar - Default Tools example</title>
|
|
20
|
+
</head>
|
|
21
|
+
|
|
22
|
+
<body class="h-100" style="background-color: #000000">
|
|
23
|
+
<div class="row h-100">
|
|
24
|
+
<div id="viewer" class="col-8 h-100" style="background-color: black">
|
|
25
|
+
<p style="position: absolute; color: white">
|
|
26
|
+
<b>Left Mouse Button:</b> Press "t" to cycle through tools
|
|
27
|
+
</p>
|
|
28
|
+
<p id="active-tool" style="position: absolute; top: 20px; color: white">
|
|
29
|
+
Active Tool: Wwwc
|
|
30
|
+
</p>
|
|
31
|
+
<p style="position: absolute; top: 40px; color: white">
|
|
32
|
+
<b>Right Mouse Button:</b> drag >> Zoom || drag + Ctrl >> Pan
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="col-4 h-100">
|
|
37
|
+
<pre class="h-100">
|
|
38
|
+
<code class="javascript" style="background-color: #000000">
|
|
39
|
+
<p style="font-size:0.6vw;">
|
|
40
|
+
let demoFiles = [];
|
|
41
|
+
let counter = 0;
|
|
42
|
+
|
|
43
|
+
const getDemoFileNames = function () {
|
|
44
|
+
let demoFileList = [];
|
|
45
|
+
for (let i = 1; i < 25; i++) {
|
|
46
|
+
let filename = "anon" + i;
|
|
47
|
+
demoFileList.push(filename);
|
|
48
|
+
}
|
|
49
|
+
return demoFileList;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// init all
|
|
53
|
+
larvitar.initLarvitarStore();
|
|
54
|
+
larvitar.initializeImageLoader();
|
|
55
|
+
larvitar.initializeCSTools();
|
|
56
|
+
larvitar.larvitar_store.addViewport("viewer");
|
|
57
|
+
|
|
58
|
+
async function createFile(fileName, cb) {
|
|
59
|
+
let response = await fetch("./demo/" + fileName);
|
|
60
|
+
let data = await response.blob();
|
|
61
|
+
let file = new File([data], fileName);
|
|
62
|
+
demoFiles.push(file);
|
|
63
|
+
counter++;
|
|
64
|
+
if (counter == 24) {
|
|
65
|
+
cb();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function renderSerie() {
|
|
70
|
+
larvitar.readFiles(demoFiles, function (seriesStack, err) {
|
|
71
|
+
let seriesId = _.keys(seriesStack)[0];
|
|
72
|
+
let serie = seriesStack[seriesId];
|
|
73
|
+
larvitar.renderImage(serie, "viewer");
|
|
74
|
+
larvitar.addDefaultTools();
|
|
75
|
+
|
|
76
|
+
let mouseConfig = {
|
|
77
|
+
keyboard_shortcuts: {
|
|
78
|
+
KEY_A: "Angle",
|
|
79
|
+
KEY_L: "Length"
|
|
80
|
+
},
|
|
81
|
+
mouse_button_left: {
|
|
82
|
+
ctrl: "Pan",
|
|
83
|
+
default: "Wwwc"
|
|
84
|
+
},
|
|
85
|
+
mouse_button_right: {
|
|
86
|
+
ctrl: "Pan",
|
|
87
|
+
default: "Zoom"
|
|
88
|
+
},
|
|
89
|
+
debug: true
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// NOTE: this also activate the tools marked as default for each mouse button
|
|
93
|
+
larvitar.addMouseKeyHandlers(mouseConfig, ["viewer"]);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let demoFileList = getDemoFileNames();
|
|
98
|
+
_.each(demoFileList, function (demoFile) {
|
|
99
|
+
createFile(demoFile, renderSerie);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
let tool_counter = 0;
|
|
103
|
+
document.onkeypress = function (e) {
|
|
104
|
+
e = e || window.event;
|
|
105
|
+
if (e.keyCode == 116 || e.keyCode == 84) {
|
|
106
|
+
let tools = _.map(larvitar.DEFAULT_TOOLS, "name");
|
|
107
|
+
// remove useless tools for the live example
|
|
108
|
+
tools = _.without(
|
|
109
|
+
tools,
|
|
110
|
+
"StackScrollMouseWheel",
|
|
111
|
+
"TextMarker",
|
|
112
|
+
"ZoomTouchPinch",
|
|
113
|
+
"PanMultiTouch",
|
|
114
|
+
"OrientationMarkers",
|
|
115
|
+
"ScaleOverlay"
|
|
116
|
+
);
|
|
117
|
+
let increment = e.shiftKey ? -1 : 1;
|
|
118
|
+
tool_counter =
|
|
119
|
+
tool_counter == tools.length - 1 ? 0 : tool_counter + increment;
|
|
120
|
+
tool_counter = tool_counter < 0 ? 0 : tool_counter;
|
|
121
|
+
let tool = tools[tool_counter];
|
|
122
|
+
larvitar.setToolActive(tool);
|
|
123
|
+
$("#active-tool").html("Active Tool: " + tool);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
</p>
|
|
127
|
+
</code>
|
|
128
|
+
</pre>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<script src="./larvitar.js"></script>
|
|
133
|
+
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
|
|
134
|
+
<script
|
|
135
|
+
src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
|
|
136
|
+
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
|
|
137
|
+
crossorigin="anonymous"
|
|
138
|
+
></script>
|
|
139
|
+
|
|
140
|
+
<script>
|
|
141
|
+
let demoFiles = [];
|
|
142
|
+
let counter = 0;
|
|
143
|
+
|
|
144
|
+
const getDemoFileNames = function () {
|
|
145
|
+
let demoFileList = [];
|
|
146
|
+
for (let i = 1; i < 25; i++) {
|
|
147
|
+
let filename = "anon" + i;
|
|
148
|
+
demoFileList.push(filename);
|
|
149
|
+
}
|
|
150
|
+
return demoFileList;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// init all
|
|
154
|
+
larvitar.initLarvitarStore();
|
|
155
|
+
larvitar.initializeImageLoader();
|
|
156
|
+
larvitar.initializeCSTools();
|
|
157
|
+
larvitar.larvitar_store.addViewport("viewer");
|
|
158
|
+
|
|
159
|
+
async function createFile(fileName, cb) {
|
|
160
|
+
let response = await fetch("./demo/" + fileName);
|
|
161
|
+
let data = await response.blob();
|
|
162
|
+
let file = new File([data], fileName);
|
|
163
|
+
demoFiles.push(file);
|
|
164
|
+
counter++;
|
|
165
|
+
if (counter == 24) {
|
|
166
|
+
cb();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function renderSerie() {
|
|
171
|
+
larvitar
|
|
172
|
+
.readFiles(demoFiles)
|
|
173
|
+
.then(seriesStack => {
|
|
174
|
+
let seriesId = _.keys(seriesStack)[0];
|
|
175
|
+
let serie = seriesStack[seriesId];
|
|
176
|
+
larvitar.renderImage(serie, "viewer").then(() => {
|
|
177
|
+
console.log("Image has been rendered");
|
|
178
|
+
});
|
|
179
|
+
larvitar.addDefaultTools();
|
|
180
|
+
|
|
181
|
+
let mouseConfig = {
|
|
182
|
+
keyboard_shortcuts: {
|
|
183
|
+
KEY_A: "Angle",
|
|
184
|
+
KEY_L: "Length"
|
|
185
|
+
},
|
|
186
|
+
mouse_button_left: {
|
|
187
|
+
ctrl: "Pan",
|
|
188
|
+
default: "Wwwc"
|
|
189
|
+
},
|
|
190
|
+
mouse_button_right: {
|
|
191
|
+
ctrl: "Pan",
|
|
192
|
+
default: "Zoom"
|
|
193
|
+
},
|
|
194
|
+
debug: true
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// NOTE: this also activate the tools marked as default for each mouse button
|
|
198
|
+
larvitar.addMouseKeyHandlers(mouseConfig, ["viewer"]);
|
|
199
|
+
})
|
|
200
|
+
.catch(err => console.log(err));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
let demoFileList = getDemoFileNames();
|
|
204
|
+
_.each(demoFileList, function (demoFile) {
|
|
205
|
+
createFile(demoFile, renderSerie);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
let tool_counter = 0;
|
|
209
|
+
document.onkeypress = function (e) {
|
|
210
|
+
e = e || window.event;
|
|
211
|
+
if (e.keyCode == 116 || e.keyCode == 84) {
|
|
212
|
+
let tools = _.map(larvitar.DEFAULT_TOOLS, "name");
|
|
213
|
+
// remove useless tools for the live example
|
|
214
|
+
tools = _.without(
|
|
215
|
+
tools,
|
|
216
|
+
"StackScrollMouseWheel",
|
|
217
|
+
"TextMarker",
|
|
218
|
+
"ZoomTouchPinch",
|
|
219
|
+
"PanMultiTouch",
|
|
220
|
+
"OrientationMarkers",
|
|
221
|
+
"ScaleOverlay"
|
|
222
|
+
);
|
|
223
|
+
// remove not working tools for the live example
|
|
224
|
+
// see open issue
|
|
225
|
+
tools = _.without(
|
|
226
|
+
tools,
|
|
227
|
+
"Brush",
|
|
228
|
+
"ThresholdsBrush",
|
|
229
|
+
"RectangleScissors",
|
|
230
|
+
"FreehandScissors",
|
|
231
|
+
"CircleScissors",
|
|
232
|
+
"CorrectionScissors",
|
|
233
|
+
"PolylineScissors"
|
|
234
|
+
);
|
|
235
|
+
let increment = e.shiftKey ? -1 : 1;
|
|
236
|
+
tool_counter =
|
|
237
|
+
tool_counter == tools.length - 1 ? 0 : tool_counter + increment;
|
|
238
|
+
tool_counter = tool_counter < 0 ? 0 : tool_counter;
|
|
239
|
+
let tool = tools[tool_counter];
|
|
240
|
+
larvitar.setToolActive(tool);
|
|
241
|
+
$("#active-tool").html("Active Tool: " + tool);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
</script>
|
|
245
|
+
</body>
|
|
246
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>Larvitar</title>
|
|
6
|
+
<link
|
|
7
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl"
|
|
10
|
+
crossorigin="anonymous"
|
|
11
|
+
/>
|
|
12
|
+
</head>
|
|
13
|
+
<body class="h-100" style="background-color: #d7e8e1">
|
|
14
|
+
<div class="container h-100">
|
|
15
|
+
<div class="row justify-content-center">
|
|
16
|
+
<div class="col-4"></div>
|
|
17
|
+
<div class="col-4 text-center">
|
|
18
|
+
<img
|
|
19
|
+
src="https://assets.pokemon.com/assets/cms2/img/pokedex/full/246.png"
|
|
20
|
+
style="height: 200px"
|
|
21
|
+
alt="..."
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="col-4"></div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div>
|
|
28
|
+
<div class="row justify-content-center">
|
|
29
|
+
<div class="col-3"></div>
|
|
30
|
+
<div class="col-6 text-center">
|
|
31
|
+
<div id="title">
|
|
32
|
+
<p class="display-5">Larvitar Examples</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="col-3"></div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<hr class="my-4" />
|
|
39
|
+
<div class="row justify-content-center">
|
|
40
|
+
<div class="col-3"></div>
|
|
41
|
+
<div class="col-6 text-center">
|
|
42
|
+
<div id="title">
|
|
43
|
+
<p class="lead">Dicom Image Toolkit for CornestoneJS</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="col-3"></div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="row justify-content-center">
|
|
50
|
+
<div class="col-2"></div>
|
|
51
|
+
<div class="col-8 text-center">
|
|
52
|
+
<a
|
|
53
|
+
class="btn btn-outline-success btn-lg"
|
|
54
|
+
href="./base.html"
|
|
55
|
+
role="button"
|
|
56
|
+
>Render
|
|
57
|
+
</a>
|
|
58
|
+
|
|
59
|
+
<a
|
|
60
|
+
class="btn btn-outline-success btn-lg"
|
|
61
|
+
href="./reslice.html"
|
|
62
|
+
role="button"
|
|
63
|
+
>Reslice
|
|
64
|
+
</a>
|
|
65
|
+
|
|
66
|
+
<a
|
|
67
|
+
class="btn btn-outline-success btn-lg"
|
|
68
|
+
href="./nrrd.html"
|
|
69
|
+
role="button"
|
|
70
|
+
>NRRD
|
|
71
|
+
</a>
|
|
72
|
+
|
|
73
|
+
<a
|
|
74
|
+
class="btn btn-outline-success btn-lg"
|
|
75
|
+
href="./defaultTools.html"
|
|
76
|
+
role="button"
|
|
77
|
+
>Tools
|
|
78
|
+
</a>
|
|
79
|
+
|
|
80
|
+
<a
|
|
81
|
+
class="btn btn-outline-success btn-lg"
|
|
82
|
+
href="./colorMaps.html"
|
|
83
|
+
role="button"
|
|
84
|
+
>Color Maps
|
|
85
|
+
</a>
|
|
86
|
+
|
|
87
|
+
<a
|
|
88
|
+
class="btn btn-outline-success btn-lg"
|
|
89
|
+
href="./layers.html"
|
|
90
|
+
role="button"
|
|
91
|
+
>Layers
|
|
92
|
+
</a>
|
|
93
|
+
|
|
94
|
+
<a
|
|
95
|
+
class="btn btn-outline-success btn-lg"
|
|
96
|
+
href="./multiframe.html"
|
|
97
|
+
role="button"
|
|
98
|
+
>Multiframe
|
|
99
|
+
</a>
|
|
100
|
+
|
|
101
|
+
<a
|
|
102
|
+
class="btn btn-outline-success btn-lg"
|
|
103
|
+
href="./masks.html"
|
|
104
|
+
role="button"
|
|
105
|
+
>Masks
|
|
106
|
+
</a>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="col-2"></div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<hr class="mt-5 mb-5" />
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div class="row align-items-end">
|
|
115
|
+
<div class="col-2"></div>
|
|
116
|
+
<div class="col-8 text-center">
|
|
117
|
+
<a href="https://www.dvisionlab.com" target="_blank">
|
|
118
|
+
<img
|
|
119
|
+
src="https://www.dvisionlab.com/images/logo_500.png"
|
|
120
|
+
style="height: 300px"
|
|
121
|
+
alt="..."
|
|
122
|
+
/>
|
|
123
|
+
</a>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="col-2"></div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</body>
|
|
129
|
+
</html>
|