kfb-view 2.3.9 → 2.4.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/.idea/workspace.xml +6 -1
- package/config/webpack.dev.conf.js +2 -1
- package/example/index.js +56 -50
- package/lib/kfb-view.js +1 -1
- package/package.json +1 -1
- package/src/components/shape/index.js +25 -24
- package/src/const/mark.js +1 -0
- package/src/view.js +2 -1
package/.idea/workspace.xml
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
<change beforePath="$PROJECT_DIR$/example/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/example/index.js" afterDir="false" />
|
|
42
42
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
43
43
|
<change beforePath="$PROJECT_DIR$/src/components/shape/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/shape/index.js" afterDir="false" />
|
|
44
|
+
<change beforePath="$PROJECT_DIR$/src/const/mark.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/const/mark.js" afterDir="false" />
|
|
45
|
+
<change beforePath="$PROJECT_DIR$/src/view.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/view.js" afterDir="false" />
|
|
44
46
|
</list>
|
|
45
47
|
<option name="SHOW_DIALOG" value="false" />
|
|
46
48
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -380,7 +382,10 @@
|
|
|
380
382
|
<workItem from="1669545429121" duration="449000" />
|
|
381
383
|
<workItem from="1669940971680" duration="1305000" />
|
|
382
384
|
<workItem from="1669965653573" duration="2149000" />
|
|
383
|
-
<workItem from="1671419756098" duration="
|
|
385
|
+
<workItem from="1671419756098" duration="2398000" />
|
|
386
|
+
<workItem from="1671437015276" duration="591000" />
|
|
387
|
+
<workItem from="1671501857160" duration="90000" />
|
|
388
|
+
<workItem from="1671751607914" duration="8964000" />
|
|
384
389
|
</task>
|
|
385
390
|
<task id="LOCAL-00067" summary="2.1.19">
|
|
386
391
|
<created>1657181784906</created>
|
|
@@ -66,7 +66,8 @@ module.exports = function() {
|
|
|
66
66
|
// target: 'http://gastric.label.hzztai.com/',
|
|
67
67
|
// target: 'http://192.168.1.91:7007',
|
|
68
68
|
// target: 'http://192.168.1.91',
|
|
69
|
-
target: 'http://192.168.1.22',
|
|
69
|
+
// target: 'http://192.168.1.22',
|
|
70
|
+
target: 'https://vai.hzztai.com',
|
|
70
71
|
// target: 'https://tct.hzztai.com',
|
|
71
72
|
// target: 'https://pis-ningbo.hzztai.com',
|
|
72
73
|
// target: 'https://pis-test.hzztai.com',
|
package/example/index.js
CHANGED
|
@@ -76,7 +76,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
76
76
|
},
|
|
77
77
|
pxConversion: {
|
|
78
78
|
unit: 'um',
|
|
79
|
-
imageCapRes: data.imageCapRes,
|
|
79
|
+
imageCapRes: data.imageCapRes || 1,
|
|
80
80
|
},
|
|
81
81
|
grid: {
|
|
82
82
|
show: false,
|
|
@@ -273,7 +273,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
273
273
|
kv.viewer.addHandler('zoom', (res) => {
|
|
274
274
|
const zoom = kv.viewer.viewport.viewportToImageZoom(res.zoom) *
|
|
275
275
|
kv.$options.scale;
|
|
276
|
-
console.log(zoom.toFixed(2) / 1);
|
|
276
|
+
// console.log(zoom.toFixed(2) / 1);
|
|
277
277
|
});
|
|
278
278
|
console.log(kv);
|
|
279
279
|
let list = [];
|
|
@@ -412,67 +412,36 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
412
412
|
}, 6000);
|
|
413
413
|
}, 6000);
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
initLabels();
|
|
416
416
|
|
|
417
417
|
function initLabels() {
|
|
418
418
|
const labels = [];
|
|
419
|
-
const colors = ['#027AFF', '#f56c6c'];
|
|
420
|
-
for (let i = 0; i <
|
|
419
|
+
const colors = ['#027AFF', '#f56c6c', '#11ff6c', '#f56cff', '#11ffff'];
|
|
420
|
+
for (let i = 0; i < 10000; i++) {
|
|
421
421
|
const point = {
|
|
422
422
|
x: Math.random() * data.width,
|
|
423
423
|
y: Math.random() * data.height,
|
|
424
424
|
};
|
|
425
|
+
const point1 = {
|
|
426
|
+
x: point.x + Math.random() * 1000,
|
|
427
|
+
y: point.y + Math.random() * 1000,
|
|
428
|
+
};
|
|
425
429
|
const label = {
|
|
426
430
|
// fillStyle: 'rgba(2, 122, 255, 1)',
|
|
427
|
-
lineWidth:
|
|
428
|
-
points: [point,
|
|
431
|
+
lineWidth: 2,
|
|
432
|
+
points: [point, point1],
|
|
429
433
|
scale: 0.1,
|
|
430
|
-
strokeStyle: Math.random()
|
|
431
|
-
tool: '
|
|
432
|
-
move:
|
|
434
|
+
strokeStyle: colors[(Math.random() * colors.length) >> 0],
|
|
435
|
+
tool: 'Rectangle',
|
|
436
|
+
move: true,
|
|
437
|
+
resize: true,
|
|
433
438
|
};
|
|
434
439
|
labels.push(label);
|
|
435
440
|
}
|
|
436
441
|
kv.initLabelList(labels);
|
|
437
442
|
}
|
|
438
443
|
|
|
439
|
-
|
|
440
|
-
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
441
|
-
then(({data}) => {
|
|
442
|
-
data = data.data;
|
|
443
|
-
const labelRegionList = [];
|
|
444
|
-
(data || []).filter(item => item.id && item.region.width > 0).
|
|
445
|
-
forEach(item => {
|
|
446
|
-
const subClass = item.sub_class || item.subClass;
|
|
447
|
-
const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
|
|
448
|
-
const r = {
|
|
449
|
-
...item,
|
|
450
|
-
tool: (item.type || item.tool) === 'Spline' ?
|
|
451
|
-
'Polygon' :
|
|
452
|
-
(item.type || item.tool),
|
|
453
|
-
strokeStyle: item.strokeStyle || `#${item.color.toString(16).
|
|
454
|
-
slice(2)}${item.color.toString(16).slice(0, 2)}`,
|
|
455
|
-
measure: true,
|
|
456
|
-
sub_class: subClass,
|
|
457
|
-
isROI: subClass === 'ROI',
|
|
458
|
-
isClose: item.isClose || item.is_close,
|
|
459
|
-
lineWidth: item.lineWidth || item.width,
|
|
460
|
-
text: item.text || item.description,
|
|
461
|
-
is_ai,
|
|
462
|
-
ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
|
|
463
|
-
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
464
|
-
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
465
|
-
};
|
|
466
|
-
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
|
|
467
|
-
labelRegionList.push({
|
|
468
|
-
...r,
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
console.time('initLabelList');
|
|
472
|
-
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
473
|
-
console.timeEnd('initLabelList');
|
|
474
|
-
});
|
|
475
|
-
document.querySelector('#reDraw').addEventListener('click', () => {
|
|
444
|
+
/*
|
|
476
445
|
instance.get(
|
|
477
446
|
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
478
447
|
then(({data}) => {
|
|
@@ -500,8 +469,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
500
469
|
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
501
470
|
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
502
471
|
};
|
|
503
|
-
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1,
|
|
504
|
-
-1);
|
|
472
|
+
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
|
|
505
473
|
labelRegionList.push({
|
|
506
474
|
...r,
|
|
507
475
|
});
|
|
@@ -510,7 +478,45 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
510
478
|
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
511
479
|
console.timeEnd('initLabelList');
|
|
512
480
|
});
|
|
513
|
-
|
|
481
|
+
document.querySelector('#reDraw').addEventListener('click', () => {
|
|
482
|
+
instance.get(
|
|
483
|
+
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
484
|
+
then(({data}) => {
|
|
485
|
+
data = data.data;
|
|
486
|
+
const labelRegionList = [];
|
|
487
|
+
(data || []).filter(item => item.id && item.region.width > 0).
|
|
488
|
+
forEach(item => {
|
|
489
|
+
const subClass = item.sub_class || item.subClass;
|
|
490
|
+
const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
|
|
491
|
+
const r = {
|
|
492
|
+
...item,
|
|
493
|
+
tool: (item.type || item.tool) === 'Spline' ?
|
|
494
|
+
'Polygon' :
|
|
495
|
+
(item.type || item.tool),
|
|
496
|
+
strokeStyle: item.strokeStyle || `#${item.color.toString(16).
|
|
497
|
+
slice(2)}${item.color.toString(16).slice(0, 2)}`,
|
|
498
|
+
measure: true,
|
|
499
|
+
sub_class: subClass,
|
|
500
|
+
isROI: subClass === 'ROI',
|
|
501
|
+
isClose: item.isClose || item.is_close,
|
|
502
|
+
lineWidth: item.lineWidth || item.width,
|
|
503
|
+
text: item.text || item.description,
|
|
504
|
+
is_ai,
|
|
505
|
+
ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
|
|
506
|
+
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
507
|
+
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
508
|
+
};
|
|
509
|
+
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1,
|
|
510
|
+
-1);
|
|
511
|
+
labelRegionList.push({
|
|
512
|
+
...r,
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
console.time('initLabelList');
|
|
516
|
+
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
517
|
+
console.timeEnd('initLabelList');
|
|
518
|
+
});
|
|
519
|
+
});*/
|
|
514
520
|
});
|
|
515
521
|
|
|
516
522
|
/**
|