@duyafeng/pseudocolor-viewer 0.1.0 → 0.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.
@@ -1,481 +0,0 @@
1
- // imageDisplayManager.js
2
- /**
3
- * 图像显示管理器
4
- * 负责图像的加载、处理和渲染
5
- */
6
-
7
- // 原始数据帧:行优先;接口存在两种尺寸(256×192 与 288×384)
8
- // rotate=true 表示源数据需逆时针旋转 90° 才是正向(256×192),false 表示本身即正向(288×384)
9
- const CANDIDATE_FRAMES = [
10
- { width: 256, height: 192, rotate: true },
11
- { width: 288, height: 384, rotate: false },
12
- ];
13
- const DEFAULT_FRAME = CANDIDATE_FRAMES[0];
14
- // 温度数据的单像素字节数:uint8 / float32 / float64
15
- const TEMP_BYTES_PER_PIXEL = [1, 4, 8];
16
-
17
- export class ImageDisplayManager {
18
- constructor(canvas, processor) {
19
- // 源数据需逆时针旋转 90° 才是正向显示,默认 256×192 → 192×256
20
- canvas.width = DEFAULT_FRAME.height;
21
- canvas.height = DEFAULT_FRAME.width;
22
- this.canvas = canvas;
23
- this.ctx = canvas.getContext('2d');
24
- this.processor = processor;
25
- this.originalImageData = null;
26
- this.currentGrayStats = { min: 0, max: 255 };// 当前图像的灰度统计
27
- this.temperatureData = null;// 存储温度数据
28
- this.temperatureStats = { min: null, max: null }; // 温度统计信息;
29
- this.red1Mode = false; // 切换图像(红色热区高亮模式)
30
- }
31
-
32
- /**
33
- * 更新显示
34
- * @param {number} wwValue - 窗宽值
35
- * @param {number} wlValue - 窗位值
36
- */
37
- updateDisplay(canvasData) {
38
- const wwValue = Number(canvasData.wwValue) * 10
39
- const wlValue = canvasData.wlValue
40
- let { imageData, grayStats, tempStats } = canvasData
41
- this.originalImageData = imageData
42
- this.currentGrayStats = grayStats
43
- this.temperatureStats = tempStats;
44
- if (!this.originalImageData) return;
45
- const tempData = new ImageData(
46
- new Uint8ClampedArray(this.originalImageData.data),
47
- this.originalImageData.width,
48
- this.originalImageData.height
49
- );
50
- // 将温度窗位转换为灰度窗位
51
- let tempWL = parseFloat(wlValue)
52
- let grayWW = parseInt(wwValue);
53
- let grayWL = undefined;
54
- if (tempWL !== undefined && this.temperatureStats.min !== null && this.currentGrayStats.min !== undefined) {
55
- grayWL = this.calculateGrayForTemp(
56
- tempWL,
57
- this.currentGrayStats.min,
58
- this.currentGrayStats.max,
59
- this.temperatureStats.min,
60
- this.temperatureStats.max
61
- );
62
- }
63
- // 应用颜色映射(传入灰度阈值参数)
64
- let coloredData;
65
- if (this.red1Mode) {
66
- coloredData = this.processor.applyRed1ColorMap(tempData, grayWL, grayWW, this.currentGrayStats);
67
- } else {
68
- coloredData = this.processor.applyTemperatureColorMap(tempData,
69
- grayWL,
70
- grayWW,
71
- this.currentGrayStats.min,
72
- this.currentGrayStats.max,
73
- this.temperatureStats.min,
74
- this.temperatureStats.max);
75
- }
76
- // 创建临时画布
77
- const tempCanvas = document.createElement('canvas');
78
- tempCanvas.width = this.originalImageData.width;
79
- tempCanvas.height = this.originalImageData.height;
80
- const tempCtx = tempCanvas.getContext('2d');
81
- tempCtx.putImageData(coloredData, 0, 0);
82
-
83
- this.ctx.imageSmoothingEnabled = false;
84
- this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
85
- this.ctx.drawImage(tempCanvas, 0, 0, this.canvas.width, this.canvas.height);
86
- }
87
- /**
88
- * 扁平数组逆时针旋转 90°(行优先)
89
- * stride 为单像素占用的元素个数:温度数组为 1,RGBA 像素为 4
90
- * 原帧 width×height → 旋转后为 height×width,返回同类型的新数组
91
- */
92
- rotateCounterclockwise90(data, width, height, stride = 1) {
93
- const rotated = new data.constructor(data.length);
94
- for (let y = 0; y < height; y++) {
95
- for (let x = 0; x < width; x++) {
96
- const from = (y * width + x) * stride;
97
- const to = ((width - 1 - x) * height + y) * stride;
98
- for (let c = 0; c < stride; c++) {
99
- rotated[to + c] = data[from + c];
100
- }
101
- }
102
- }
103
- return rotated;
104
- }
105
- /**
106
- * 源帧对应的显示帧:需旋转的做逆时针 90°,长宽互换;不需旋转的保持原尺寸
107
- */
108
- getDisplayFrame({ width, height, rotate }) {
109
- return rotate ? { width: height, height: width } : { width, height };
110
- }
111
- /**
112
- * 按帧要求调整数据朝向,旋转帧做逆时针 90°,不旋转帧原样返回
113
- * stride 为单像素占用的元素个数:温度数组为 1,RGBA 像素为 4
114
- */
115
- orientData(data, frame, stride = 1) {
116
- return frame.rotate
117
- ? this.rotateCounterclockwise90(data, frame.width, frame.height, stride)
118
- : data;
119
- }
120
- /**
121
- * 按解码后的字节长度区分源数据尺寸
122
- * 在 CANDIDATE_FRAMES 中匹配 (宽,高) 组合(256×192 / 288×384),
123
- * 温度数据再按单像素字节数区分 uint8 / float32 / float64
124
- * @param {number} byteLength - 解码后的字节长度
125
- * @param {number[]} bytesPerPixelList - 允许的单像素字节数,灰度固定为 [1]
126
- * @returns {{width:number, height:number, rotate:boolean, bytesPerPixel:number}}
127
- */
128
- resolveSourceFrame(byteLength, bytesPerPixelList = [1]) {
129
- for (const bytesPerPixel of bytesPerPixelList) {
130
- for (const frame of CANDIDATE_FRAMES) {
131
- if (byteLength === frame.width * frame.height * bytesPerPixel) {
132
- // 保留 rotate 标记,供 getDisplayFrame / orientData 使用
133
- return { ...frame, bytesPerPixel };
134
- }
135
- }
136
- }
137
- throw new Error(
138
- `数据长度不匹配!检测到 ${byteLength} 字节,预期尺寸 ${CANDIDATE_FRAMES.map(f => `${f.width}×${f.height}`).join(' 或 ')}、单像素 ${bytesPerPixelList.join('/')} 字节`
139
- );
140
- }
141
- /**
142
- * 解析Base64数据并创建图像
143
- * @param {string} base64Input - Base64编码的数据
144
- * @returns {object} 包含图像数据和统计信息的对象
145
- */
146
- parseImageFromBase64(base64Input) {
147
- const binaryString = atob(base64Input.trim());
148
- const bytes = new Uint8Array(binaryString.length);
149
- for (let i = 0; i < binaryString.length; i++) {
150
- bytes[i] = binaryString.charCodeAt(i);
151
- }
152
- // 灰度数据为单字节灰度,按字节长度区分尺寸(256×192 / 288×384)
153
- const frame = this.resolveSourceFrame(bytes.length);
154
-
155
- const tempCanvas = document.createElement('canvas');
156
- tempCanvas.width = frame.width;
157
- tempCanvas.height = frame.height;
158
- const tempCtx = tempCanvas.getContext('2d');
159
-
160
- const imageData = tempCtx.createImageData(frame.width, frame.height);
161
-
162
- let minGray = 255;
163
- let maxGray = 0;
164
- let sumGray = 0;
165
-
166
- for (let i = 0; i < bytes.length; i++) {
167
- const gray = bytes[i];
168
- imageData.data[i * 4] = gray;
169
- imageData.data[i * 4 + 1] = gray;
170
- imageData.data[i * 4 + 2] = gray;
171
- imageData.data[i * 4 + 3] = 255;
172
-
173
- minGray = Math.min(minGray, gray);
174
- maxGray = Math.max(maxGray, gray);
175
- sumGray += gray;
176
- }
177
-
178
- const avgGray = (sumGray / bytes.length).toFixed(2);
179
- // 保存灰度统计信息
180
- this.currentGrayStats = { min: minGray, max: maxGray };
181
- // 按帧要求调整朝向:256×192 需逆时针旋转 90°(→192×256),288×384 保持原样
182
- const displayFrame = this.getDisplayFrame(frame);
183
- const displayGray = this.orientData(imageData.data, frame, 4);
184
- const orientedImageData = new ImageData(displayGray, displayFrame.width, displayFrame.height);
185
- this.originalImageData = orientedImageData
186
- // 画布逻辑尺寸随实际数据尺寸切换(192×256 或 288×384)
187
- this.canvas.width = orientedImageData.width;
188
- this.canvas.height = orientedImageData.height;
189
- return {
190
- imageData: orientedImageData,
191
- grayStats: { min: minGray, max: maxGray, avg: avgGray },
192
- dataSize: `${bytes.length.toLocaleString()} 字节`
193
- };
194
- }
195
-
196
- /**
197
- * 解析温度数据
198
- * @param {string} base64Input - Base64编码的温度数据
199
- * @returns {object} 包含温度数据和统计信息的对象
200
- */
201
- parseTemperatureData(base64Input) {
202
- const binaryString = atob(base64Input.trim());
203
- const bytes = new Uint8Array(binaryString.length);
204
- for (let i = 0; i < binaryString.length; i++) {
205
- bytes[i] = binaryString.charCodeAt(i);
206
- }
207
-
208
- // const floatArray = new Float32Array(bytes.buffer);
209
- const dataLength = bytes.length;
210
- // 按字节长度区分尺寸(256×192 / 288×384)与单像素字节数(uint8/float32/float64)
211
- const frame = this.resolveSourceFrame(dataLength, TEMP_BYTES_PER_PIXEL);
212
- let floatArray;
213
- if (frame.bytesPerPixel === 1) {
214
- // uint8 格式
215
- // 将 uint8 转换为 float32 数组(直接使用 uint8 值作为温度)
216
- floatArray = new Float32Array(bytes.length);
217
- for (let i = 0; i < bytes.length; i++) {
218
- floatArray[i] = bytes[i];
219
- }
220
- } else if (frame.bytesPerPixel === 4) {
221
- // float32 格式
222
- floatArray = new Float32Array(bytes.buffer);
223
- } else {
224
- // float64 格式
225
- const float64Array = new Float64Array(bytes.buffer);
226
- // 将 float64 转换为 float32 数组
227
- floatArray = new Float32Array(float64Array.length);
228
- for (let i = 0; i < float64Array.length; i++) {
229
- floatArray[i] = float64Array[i];
230
- }
231
- }
232
- let minTemp = Infinity;
233
- let maxTemp = -Infinity;
234
- let sumTemp = 0;
235
-
236
- for (let i = 0; i < floatArray.length; i++) {
237
- const temp = floatArray[i];
238
- minTemp = Math.min(minTemp, temp);
239
- maxTemp = Math.max(maxTemp, temp);
240
- sumTemp += temp;
241
- }
242
-
243
- const avgTemp = sumTemp / floatArray.length;
244
- // 保存温度统计信息到全局变量
245
- this.temperatureStats = { min: minTemp, max: maxTemp };
246
- // 验证温度数据点数是否与灰度数据一致
247
- if (this.originalImageData) {
248
- const grayPixelCount = this.originalImageData.width * this.originalImageData.height;
249
- if (floatArray.length === grayPixelCount) {
250
- } else {
251
- console.warn(`⚠ 温度数据点数(${floatArray.length})与灰度图像像素数(${grayPixelCount})不一致`);
252
- }
253
- }
254
- // 如果有灰度数据,进行插值计算
255
- if (this.currentGrayStats.min !== undefined && this.currentGrayStats.max !== undefined) {
256
- const mapping = this.calculateGrayToTempMapping(
257
- this.currentGrayStats.min,
258
- this.currentGrayStats.max,
259
- minTemp,
260
- maxTemp
261
- );
262
-
263
- // if (mapping.tempAtGray0 !== null) {
264
- // document.getElementById('tempAtGray0').textContent = mapping.tempAtGray0.toFixed(2) + ' °C';
265
- // document.getElementById('tempAtGray255').textContent = mapping.tempAtGray255.toFixed(2) + ' °C';
266
-
267
- // // 同时更新当前窗位对应的温度
268
- // this.updateCurrentWLTemperature();
269
- // } else {
270
- // document.getElementById('tempAtGray0').textContent = '无法计算';
271
- // document.getElementById('tempAtGray255').textContent = '无法计算';
272
- // }
273
- }
274
- const tempRange = maxTemp - minTemp
275
- // 计算温度窗位初始值(温度范围的1/2位置,更偏左一些)
276
- const initialTempWL = minTemp + tempRange * 1 / 3;
277
- // 温度数据与灰度图像使用同一套朝向规则,保证坐标一致
278
- const orientedTemps = this.orientData(floatArray, frame);
279
- this.temperatureData = orientedTemps;
280
- return {
281
- data: orientedTemps,
282
- stats: {
283
- count: orientedTemps.length.toLocaleString(),
284
- min: minTemp,
285
- max: maxTemp,
286
- initValue: initialTempWL,
287
- avg: avgTemp
288
- }
289
- };
290
- }
291
-
292
- // 计算任意灰度值对应的温度(灰度→温度)
293
- calculateTempForGray(gray, grayMin, grayMax, tempMin, tempMax) {
294
- // 检查输入有效性
295
- if (grayMin === grayMax) {
296
- return null;
297
- }
298
-
299
- // 使用非线性映射的反向计算,与calculateGrayForTemp保持一致
300
- const tempRange = tempMax - tempMin;
301
- const grayRange = grayMax - grayMin;
302
-
303
- // 归一化灰度到 [0, 1] 范围
304
- const normalizedGray = (gray - grayMin) / grayRange;
305
-
306
- // 应用幂函数的反向(平方函数)
307
- const adjustedGray = normalizedGray * normalizedGray;
308
-
309
- // 映射回温度范围
310
- const temp = tempMin + adjustedGray * tempRange;
311
- return temp;
312
- }
313
- // 计算任意温度值对应的灰度(温度→灰度)
314
- calculateGrayForTemp(temp, grayMin, grayMax, tempMin, tempMax) {
315
- // 检查输入有效性
316
- if (tempMin === tempMax) {
317
- return null;
318
- }
319
-
320
- // 使用非线性映射,让温度变化对应的灰度变化更平缓
321
- // 使用幂函数,让低温度区域变化更慢,高温度区域变化更快
322
- const tempRange = tempMax - tempMin;
323
- const grayRange = grayMax - grayMin;
324
-
325
- // 归一化温度到 [0, 1] 范围
326
- const normalizedTemp = (temp - tempMin) / tempRange;
327
-
328
- // 应用幂函数,让变化更平缓(使用0.5次方,相当于平方根)
329
- const adjustedTemp = Math.pow(normalizedTemp, 0.5);
330
-
331
- // 映射回灰度范围
332
- const gray = grayMin + adjustedTemp * grayRange;
333
- return gray;
334
- }
335
- // 灰度-温度线性插值计算
336
- calculateGrayToTempMapping(grayMin, grayMax, tempMin, tempMax) {
337
- // 检查输入有效性
338
- if (grayMin === grayMax) {
339
- console.warn('灰度范围为0,无法进行插值计算');
340
- return { tempAtGray0: null, tempAtGray255: null };
341
- }
342
-
343
- // 计算灰度索引 0 对应的温度
344
- const tempAtGray0 = this.calculateTempForGray(0, grayMin, grayMax, tempMin, tempMax);
345
-
346
- // 计算灰度索引 255 对应的温度
347
- const tempAtGray255 = this.calculateTempForGray(255, grayMin, grayMax, tempMin, tempMax);
348
- return {
349
- tempAtGray0: tempAtGray0,
350
- tempAtGray255: tempAtGray255
351
- };
352
- }
353
- /**
354
- * 设置切换图像(红色热区高亮)模式
355
- * @param {boolean} flag
356
- */
357
- setRed1Mode(flag) {
358
- this.red1Mode = Boolean(flag);
359
- }
360
- updateWindow({ grayWW, tempWL, canvasData }) {
361
- let { grayStats, tempStats, wlRange, wlValue, imageData } = canvasData
362
- this.originalImageData = imageData
363
- this.currentGrayStats = grayStats
364
- this.temperatureStats = tempStats
365
- // 根据当前窗宽动态更新窗位最小值:给更多空间,让窗位可以向左移动更多
366
- const minGrayForWL = grayStats.min; // 使用固定偏移量,与初始化保持一致
367
- const tempWLMin = this.calculateTempForGray(minGrayForWL, grayStats.min, grayStats.max, tempStats.min, tempStats.max);
368
-
369
- // 更新窗位滑块的最小值
370
- const oldMin = parseFloat(wlRange.min);
371
- const newMin = tempWLMin.toFixed(2);
372
-
373
- if (tempWLMin !== null && oldMin !== parseFloat(newMin)) {
374
- wlRange.min = newMin;
375
-
376
- // 如果当前窗位小于新的最小值,需要调整
377
- if (tempWL < parseFloat(newMin)) {
378
- wlValue = newMin;
379
- // document.getElementById('wlValue').textContent = newMin;
380
- }
381
- }
382
-
383
- // 将温度窗位转换为灰度窗位
384
- const currentTempWL = parseFloat(wlValue);
385
- const grayWL = this.calculateGrayForTemp(
386
- currentTempWL,
387
- grayStats.min,
388
- grayStats.max,
389
- tempStats.min,
390
- tempStats.max
391
- );
392
-
393
- if (grayWL === null) {
394
- console.error('无法将温度窗位转换为灰度窗位');
395
- return;
396
- }
397
-
398
-
399
- // 使用灰度窗宽和转换后的灰度窗位更新 LUT
400
- this.processor.updateLUT(grayWW, grayWL);
401
- // this.updateDisplay(canvasData);
402
- }
403
- setupMouseTemperatureDisplay({ canvasData, canvas }) {
404
- let { grayStats, tempStats, imageData } = canvasData
405
- const tooltip = canvas.parentElement.querySelector('.floating-temp');
406
- let downCurrentCanvasData = null;
407
- // 鼠标离开canvas时隐藏tooltip
408
- const handleMouseLeave = () => {
409
- if (tooltip) {
410
- tooltip.style.display = 'none';
411
- }
412
- }
413
-
414
- // 鼠标进入canvas时显示tooltip(如果鼠标在有效区域内)
415
- const handleMouseEnter = (event) => {
416
- handleMouseMove(event);
417
- }
418
- const handleMouseMove = (event) => {
419
- const canvas1 = event.target;
420
- if (!imageData || tempStats.min === null || grayStats.min === undefined) {
421
- tooltip.style.display = 'none';
422
- return;
423
- }
424
- const IMAGE_WIDTH = canvas1.width;
425
- const IMAGE_HEIGHT = canvas1.height;
426
- // 获取鼠标在canvas中的相对位置
427
- const rect = canvas1.getBoundingClientRect();
428
- const x = event.clientX - rect.left;
429
- const y = event.clientY - rect.top;
430
- // 计算实际温度坐标
431
- const pixelScaleX = IMAGE_WIDTH / rect.width;
432
- const pixelScaleY = IMAGE_HEIGHT / rect.height;
433
- const pixelX = Math.floor(x * pixelScaleX);
434
- const pixelY = Math.floor(y * pixelScaleY);
435
- const index = pixelY * IMAGE_WIDTH + pixelX;
436
- // 检查坐标是否在图像范围内
437
- if (pixelX >= 0 && pixelX < IMAGE_WIDTH && pixelY >= 0 && pixelY < IMAGE_HEIGHT) {
438
- try {
439
- if (canvas1.tempData && canvas1.tempData[index] !== undefined) {
440
- const temperature = canvas1.tempData[index]
441
- if (temperature !== null && !isNaN(temperature)) {
442
- // 更新tooltip内容
443
- tooltip.textContent = `温度: ${temperature.toFixed(2)}°C`;
444
- // 显示tooltip
445
- tooltip.style.display = 'block';
446
- // 设置tooltip位置(跟随鼠标,稍微偏移避免遮挡)
447
- const tooltipX = Math.min(x + 15, rect.width); // 避免超出右边界
448
- const tooltipY = Math.max(y + 100, 10); // 避免超出上边界
449
- tooltip.style.left = tooltipX + 'px';
450
- // tooltip.style.left = event.clientX -120 + 'px';
451
- tooltip.style.top = tooltipY + 'px';
452
- // tooltip.style.top = event.clientY - 25 + 'px';
453
- } else {
454
- tooltip.style.display = 'none';
455
- }
456
- }
457
- } catch (error) {
458
- console.warn('计算温度值时出错:', error);
459
- tooltip.style.display = 'none';
460
- }
461
-
462
- } else if (tooltip) {
463
- tooltip.style.display = 'none';
464
- }
465
- }
466
- // 移除之前的事件监听器(避免重复绑定)
467
- canvas.removeEventListener('mousemove', handleMouseMove);
468
- canvas.removeEventListener('mouseleave', handleMouseLeave);
469
- canvas.removeEventListener('mouseenter', handleMouseEnter);
470
- // canvas.removeEventListener('mousedown', handleMouseDown);
471
- // 鼠标移动事件处理函数
472
- // 添加事件监听器
473
- canvas.addEventListener('mousemove', handleMouseMove);
474
- canvas.addEventListener('mouseleave', handleMouseLeave);
475
- canvas.addEventListener('mouseenter', handleMouseEnter);
476
- // canvas.addEventListener('mousedown', handleMouseDown);
477
- return { downCurrentCanvasData };
478
- }
479
- }
480
-
481
- export default ImageDisplayManager;
@@ -1,88 +0,0 @@
1
- /*
2
- 主要功能:
3
- 维护固定长度的队列,存储图像对象
4
- 防止重复插入相同unique_key的对象
5
- 队列满时自动执行"先进先出"策略(左侧移出,右侧加入)
6
- 提供对象查找和队列状态查询功能
7
-
8
- 核心方法:
9
- insert(object): 插入新对象,处理队列满的情况
10
-
11
- isExist(object): 检查对象是否已存在
12
-
13
- getUniqueKeyValue(unique_key): 根据唯一键查找对象
14
-
15
- getActImgItemCount(): 获取当前队列中实际对象数量
16
- */
17
- export default class ImageQueue {//类实现了一个固定长度的队列系统,用于管理图像对象
18
- constructor(numSpaces) {
19
- this.queues = new Array(numSpaces).fill(null); // 初始化空格队列
20
- this.count = 0; // 当前已填充的空格数量
21
- }
22
- update(object, index) {
23
- this.queues[index] = object;
24
- }
25
- getUniqueKeyValue(unique_key){
26
- let object = null;
27
- this.queues.forEach((itemObj, index) => {
28
- if (itemObj === null) {
29
- return
30
- } else {
31
- const itemKey = itemObj.unique_key || itemObj.bodyFlag || itemObj.imageFlag;
32
- if (itemKey == unique_key) {
33
- object = itemObj
34
- return
35
- }
36
- }
37
- });
38
- return object
39
- }
40
- isExist(object) {
41
- const objKey = object.unique_key || object.bodyFlag || object.imageFlag;
42
- if (!objKey) return false;
43
- let is_exist = false
44
- this.queues.forEach((itemObj, index) => {
45
- if (itemObj === null) {
46
- return
47
- } else {
48
- const itemKey = itemObj.unique_key || itemObj.bodyFlag || itemObj.imageFlag;
49
- if (objKey == itemKey) {
50
- is_exist = true
51
- return
52
- }
53
- }
54
- });
55
- return is_exist
56
- }
57
-
58
- // 插入新图片的核心逻辑
59
- insert(object) {
60
- if (this.isExist(object) == true) {
61
- return
62
- }
63
-
64
- if (this.count < this.queues.length) {
65
- // order
66
- // 情况1:队列未满,直接填充到下一个空位
67
- this.queues[this.count] = object;
68
- this.count++;
69
- } else {
70
- // 情况2:队列已满,整体左移后放入末尾
71
- for (let i = 0; i < this.queues.length - 1; i++) {
72
- this.queues[i] = this.queues[i + 1]; // 所有图片向前移动一格
73
- }
74
- this.queues[this.queues.length - 1] = object; // 新图片放入最后空格
75
- }
76
- }
77
- getQueues() {
78
- return this.queues;
79
- }
80
- getActImgItemCount() {
81
- let imgContainer = this.queues.filter(item => item !== null);
82
- if (imgContainer == null) {
83
- return 0
84
- }
85
- return imgContainer.length;
86
- }
87
- }
88
-
package/lib/index.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * 组件内部引擎(自包含,不依赖任何外部包)
3
- * 从 @/utils/pseudoColor/ 完整迁移
4
- */
5
- import MedicalColorProcessor from './medicalColorProcessor.js';
6
- import ImageDisplayManager from './imageDisplayManager.js';
7
- import WindowLevelController from './windowLevelController.js';
8
- import ImageQueue from './imageModule.js';
9
- import canvasRectangle from './canvasRectangle.js';
10
-
11
- export {
12
- MedicalColorProcessor,
13
- ImageDisplayManager,
14
- WindowLevelController,
15
- ImageQueue,
16
- canvasRectangle as canvasUtils,
17
- };