dwv 0.37.0-beta.8 → 0.37.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/dist/assets/workers/jpeg2000.worker.min.js +1 -1
- package/dist/assets/workers/jpeg2000.worker.min.js.map +1 -1
- package/dist/assets/workers/jpegbaseline.worker.min.js +1 -1
- package/dist/assets/workers/jpegbaseline.worker.min.js.map +1 -1
- package/dist/assets/workers/jpegloss.worker.min.js +1 -1
- package/dist/assets/workers/jpegloss.worker.min.js.map +1 -1
- package/dist/assets/workers/labeling.worker.min.js +1 -1
- package/dist/assets/workers/labeling.worker.min.js.map +1 -1
- package/dist/assets/workers/resampling.worker.min.js +1 -1
- package/dist/assets/workers/resampling.worker.min.js.map +1 -1
- package/dist/assets/workers/rle.worker.min.js +1 -1
- package/dist/assets/workers/rle.worker.min.js.map +1 -1
- package/dist/dwv.d.ts +1333 -314
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/dist/dwv.node.min.js +1 -1
- package/dist/dwv.node.min.js.map +1 -1
- package/package.json +21 -23
- package/readme.md +7 -3
- package/dev/bench/bench.html +0 -94
- package/dev/bench/bench.js +0 -316
- package/dev/bench/benchFunctionRunner.js +0 -83
- package/dev/bench/dataRunner.js +0 -171
- package/dev/bench/gui.js +0 -184
- package/dev/bench/listen.js +0 -70
- package/dev/bench/parsers/dwv-current.html +0 -45
- package/dev/bench/parsers/dwv-previous.html +0 -45
- package/dev/dicom/binaryPixGenerator.js +0 -108
- package/dev/dicom/dicomGenerator.js +0 -215
- package/dev/dicom/filePixGenerator.js +0 -96
- package/dev/dicom/gradSquarePixGenerator.js +0 -107
- package/dev/dicom/mprPixGenerator.js +0 -247
- package/dev/dicom/pages/anonymiser.html +0 -86
- package/dev/dicom/pages/anonymiser.js +0 -154
- package/dev/dicom/pages/diff.html +0 -34
- package/dev/dicom/pages/diff.js +0 -97
- package/dev/dicom/pages/generator.html +0 -92
- package/dev/dicom/pages/generator.js +0 -329
- package/dev/dicom/pages/synthetic-data.html +0 -19
- package/dev/dicom/pages/synthetic-data.js +0 -164
- package/dev/dicom/squarePixGenerator.js +0 -233
- package/dev/favicon.ico +0 -0
- package/dev/image/pages/colourmaps.html +0 -16
- package/dev/image/pages/colourmaps.js +0 -65
- package/dev/index.html +0 -38
- package/dev/pacs/dcmweb.html +0 -80
- package/dev/pacs/dcmweb.js +0 -577
- package/dev/pacs/images/acute_leukemia.png +0 -0
- package/dev/pacs/images/babymri-dcmdir.png +0 -0
- package/dev/pacs/images/babymri-rect.png +0 -0
- package/dev/pacs/images/babymri-zip.png +0 -0
- package/dev/pacs/images/babymri.png +0 -0
- package/dev/pacs/images/brainmri-png.png +0 -0
- package/dev/pacs/images/brainpet-jpg.png +0 -0
- package/dev/pacs/images/cerebrix.png +0 -0
- package/dev/pacs/images/goudurix.png +0 -0
- package/dev/pacs/images/multiframe-test1.png +0 -0
- package/dev/pacs/images/toutatix.png +0 -0
- package/dev/pacs/images/us.png +0 -0
- package/dev/pacs/index.html +0 -97
- package/dev/pacs/index.js +0 -287
- package/dev/pacs/overlays.js +0 -51
- package/dev/pacs/viewer.html +0 -401
- package/dev/pacs/viewer.js +0 -1275
- package/dev/pacs/viewer.rendertest.js +0 -96
- package/dev/pacs/viewer.ui.annot.js +0 -607
- package/dev/pacs/viewer.ui.brush.js +0 -181
- package/dev/pacs/viewer.ui.datatable.js +0 -674
- package/dev/pacs/viewer.ui.draw.js +0 -141
- package/dev/pacs/viewer.ui.icons.js +0 -88
- package/dev/pacs/viewer.ui.js +0 -198
- package/dev/pacs/viewer.ui.segment.js +0 -1369
- package/dev/visual/appgui.js +0 -125
- package/dev/visual/images/dicompyler-ct.0.jpg +0 -0
- package/dev/visual/images/gdcm-CR-MONO1-10-chest.jpg +0 -0
- package/dev/visual/images/gdcm-CT-MONO2-8-abdo.jpg +0 -0
- package/dev/visual/images/gdcm-US-RGB-8-epicard.jpg +0 -0
- package/dev/visual/images/gdcm-US-RGB-8-esopecho.jpg +0 -0
- package/dev/visual/images/leadtools-8BitsJpegLossyGrayScale.jpg +0 -0
- package/dev/visual/images/leadtools-flowers-16-mono2-rle.jpg +0 -0
- package/dev/visual/images/leadtools-flowers-8-mono2-rle.jpg +0 -0
- package/dev/visual/images/nema-ct1_j2ki.jpg +0 -0
- package/dev/visual/images/nema-ct1_jpll.jpg +0 -0
- package/dev/visual/images/nema-mr1_jply.jpg +0 -0
- package/dev/visual/images/nema-nm1_j2kr.jpg +0 -0
- package/dev/visual/images/nema-nm1_jpll.jpg +0 -0
- package/dev/visual/images/nema-nm1_jply.jpg +0 -0
- package/dev/visual/images/nema-us1_j2ki.jpg +0 -0
- package/dev/visual/images/nema-vl2_j2kr.jpg +0 -0
- package/dev/visual/images/osirix-cerebrix.jpg +0 -0
- package/dev/visual/images/osirix-goudurix.jpg +0 -0
- package/dev/visual/images/osirix-toutatix-100.jpg +0 -0
- package/dev/visual/index-jpeg.js +0 -104
- package/dev/visual/index-jpeg2000.js +0 -103
- package/dev/visual/index-rle.js +0 -70
- package/dev/visual/index.html +0 -20
- package/dev/visual/index.js +0 -123
- package/dev/visual/style.css +0 -37
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import {getControlDiv} from './viewer.ui.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @import {App} from '../../src/app/application.js';
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Brush tool UI.
|
|
9
|
-
*/
|
|
10
|
-
export class BrushToolUI {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The associated application.
|
|
14
|
-
*
|
|
15
|
-
* @type {App}
|
|
16
|
-
*/
|
|
17
|
-
#app;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {App} app The associated application.
|
|
21
|
-
*/
|
|
22
|
-
constructor(app, /*toolConfig*/) {
|
|
23
|
-
this.#app = app;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Bind app to ui.
|
|
28
|
-
*/
|
|
29
|
-
registerListeners() {
|
|
30
|
-
// listen to brush size event (via shortcut)
|
|
31
|
-
this.#app.addEventListener('brushsizechange', this.#onBrushSizeChange);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get the value of the tool UI.
|
|
36
|
-
*
|
|
37
|
-
* @returns {object|undefined} The value.
|
|
38
|
-
*/
|
|
39
|
-
getValue() {
|
|
40
|
-
return undefined;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get the HTML element of the tool UI.
|
|
45
|
-
*
|
|
46
|
-
* @returns {HTMLElement|undefined} The element.
|
|
47
|
-
*/
|
|
48
|
-
getHtml() {
|
|
49
|
-
// list of segmentations
|
|
50
|
-
const res = document.createElement('ul');
|
|
51
|
-
res.id = 'toolFeatures';
|
|
52
|
-
res.className = 'toolFeatures';
|
|
53
|
-
|
|
54
|
-
// brush size input
|
|
55
|
-
const sizeCallback = (size) => {
|
|
56
|
-
this.#app.setToolFeatures({brushSize: size});
|
|
57
|
-
//this.updateBrushCursorSize(size);
|
|
58
|
-
};
|
|
59
|
-
// set default size
|
|
60
|
-
const defaultCursorSize = 10;
|
|
61
|
-
this.#app.setToolFeatures({brushSize: defaultCursorSize});
|
|
62
|
-
// append range
|
|
63
|
-
const controlDiv = getControlDiv(
|
|
64
|
-
'brush-size',
|
|
65
|
-
'Brush size',
|
|
66
|
-
1,
|
|
67
|
-
20,
|
|
68
|
-
defaultCursorSize,
|
|
69
|
-
sizeCallback,
|
|
70
|
-
undefined,
|
|
71
|
-
1
|
|
72
|
-
);
|
|
73
|
-
res.appendChild(controlDiv);
|
|
74
|
-
|
|
75
|
-
// if no segmentations, use default
|
|
76
|
-
if (!document.getElementById('segmentation-list')) {
|
|
77
|
-
const features = {
|
|
78
|
-
brushMode: 'add',
|
|
79
|
-
selectedSegmentNumber: 1,
|
|
80
|
-
createMask: true
|
|
81
|
-
};
|
|
82
|
-
console.log('set tool features [add-default]', features);
|
|
83
|
-
this.#app.setToolFeatures(features);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return res;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Handle brush size change event.
|
|
91
|
-
*
|
|
92
|
-
* @param {CustomEvent} event The change event.
|
|
93
|
-
*/
|
|
94
|
-
#onBrushSizeChange(event) {
|
|
95
|
-
const newValue = event.detail.value;
|
|
96
|
-
const controlRange = document.getElementById('brush-size-range');
|
|
97
|
-
const controlValue = document.getElementById('brush-size-number');
|
|
98
|
-
if (controlRange && controlValue) {
|
|
99
|
-
controlRange.value = newValue;
|
|
100
|
-
controlValue.value = newValue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Update the brush cursor size.
|
|
106
|
-
*
|
|
107
|
-
* @param {number} _brushSize The new size.
|
|
108
|
-
*/
|
|
109
|
-
// #updateBrushCursorSize(_brushSize) {
|
|
110
|
-
// const stgCtrl = this.#app.getStageController();
|
|
111
|
-
// const lg = stgCtrl.getActiveLayerGroup();
|
|
112
|
-
// if (typeof lg === 'undefined') {
|
|
113
|
-
// throw new Error('No active layer group for brush cursor');
|
|
114
|
-
// }
|
|
115
|
-
// const vl = lg.getActiveViewLayer();
|
|
116
|
-
// if (typeof vl === 'undefined') {
|
|
117
|
-
// throw new Error('No active view layer for brush cursor');
|
|
118
|
-
// }
|
|
119
|
-
// const scale = vl.getScale();
|
|
120
|
-
// const spacing = vl.getViewController().get2DSpacing();
|
|
121
|
-
|
|
122
|
-
// const width = 2 * brushSize * Math.abs(scale.x) / spacing.x;
|
|
123
|
-
// const height = 2 * brushSize * Math.abs(scale.y) / spacing.y;
|
|
124
|
-
|
|
125
|
-
// const cursorDiv = document.getElementById('brushCursor');
|
|
126
|
-
// cursorDiv.style.width = Math.round(width) + 'px';
|
|
127
|
-
// cursorDiv.style.height = Math.round(height) + 'px';
|
|
128
|
-
// }
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Add the brush cursor to the dom.
|
|
132
|
-
*/
|
|
133
|
-
// #addBrushCursor() {
|
|
134
|
-
// // cursor div
|
|
135
|
-
// const cursorDiv = document.createElement('div');
|
|
136
|
-
// cursorDiv.id = 'brushCursor';
|
|
137
|
-
// document.body.prepend(cursorDiv);
|
|
138
|
-
|
|
139
|
-
// // default size
|
|
140
|
-
// const cursorRange = document.getElementById('brush-size-range');
|
|
141
|
-
// this.#updateBrushCursorSize(parseInt(cursorRange.value, 10));
|
|
142
|
-
|
|
143
|
-
// // update position on mouse move
|
|
144
|
-
// window.addEventListener('mousemove', updateBrushCursorPos);
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
}; // BrushToolUI
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Update the brush cursor on mouse move.
|
|
151
|
-
*
|
|
152
|
-
* @param event The mouse move event.
|
|
153
|
-
*/
|
|
154
|
-
// function updateBrushCursorPos(event) {
|
|
155
|
-
// const cursorDiv = document.getElementById('brushCursor');
|
|
156
|
-
// // calculate shape half sizes
|
|
157
|
-
// const width = cursorDiv.clientWidth;
|
|
158
|
-
// const left = cursorDiv.offsetLeft + (cursorDiv.offsetWidth - width);
|
|
159
|
-
// const halfX = left + width / 2;
|
|
160
|
-
// const height = cursorDiv.clientHeight;
|
|
161
|
-
// const top = cursorDiv.offsetTop + (cursorDiv.offsetHeight - height);
|
|
162
|
-
// const halfY = top + height / 2;
|
|
163
|
-
// // new cursor position
|
|
164
|
-
// const mouseX = event.clientX - halfX;
|
|
165
|
-
// const mouseY = event.clientY - halfY;
|
|
166
|
-
// cursorDiv.style.translate = `${mouseX}px ${mouseY}px`;
|
|
167
|
-
// }
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Remove the brush cursor from the dom.
|
|
171
|
-
*/
|
|
172
|
-
// function removeBrushCursor() {
|
|
173
|
-
// // remove div
|
|
174
|
-
// const cursorDiv = document.getElementById('brushCursor');
|
|
175
|
-
// if (cursorDiv) {
|
|
176
|
-
// cursorDiv.remove();
|
|
177
|
-
// }
|
|
178
|
-
|
|
179
|
-
// // stop listening on mouse move
|
|
180
|
-
// window.removeEventListener('mousemove', updateBrushCursorPos);
|
|
181
|
-
// }
|