kfb-view 2.4.1 → 2.4.2

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.
@@ -39,10 +39,9 @@
39
39
  </select>
40
40
  </component>
41
41
  <component name="ChangeListManager">
42
- <list default="true" id="55024232-8108-4dc9-9bd3-0fd2aa2f34f8" name="Default Changelist" comment="截图区域范围数值保留2位小数">
43
- <change beforePath="$PROJECT_DIR$/config/webpack.dev.conf.js" beforeDir="false" afterPath="$PROJECT_DIR$/config/webpack.dev.conf.js" afterDir="false" />
44
- <change beforePath="$PROJECT_DIR$/example/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/example/index.js" afterDir="false" />
42
+ <list default="true" id="55024232-8108-4dc9-9bd3-0fd2aa2f34f8" name="Default Changelist" comment="build:3.0.1">
45
43
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
44
+ <change beforePath="$PROJECT_DIR$/src/components/shape/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/shape/index.js" afterDir="false" />
46
45
  </list>
47
46
  <option name="SHOW_DIALOG" value="false" />
48
47
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -78,31 +77,32 @@
78
77
  <option name="hideEmptyMiddlePackages" value="true" />
79
78
  <option name="showLibraryContents" value="true" />
80
79
  </component>
81
- <component name="PropertiesComponent"><![CDATA[{
82
- "keyToString": {
83
- "DefaultHtmlFileTemplate": "HTML File",
84
- "Project.color": "4c401d",
85
- "WebServerToolWindowFactoryState": "false",
86
- "dart.analysis.tool.window.visible": "false",
87
- "last_opened_file_path": "/home/fanqifeng/WebstormProjects/kfb-view",
88
- "node.js.detected.package.eslint": "true",
89
- "node.js.detected.package.tslint": "true",
90
- "node.js.selected.package.eslint": "(autodetect)",
91
- "node.js.selected.package.tslint": "(autodetect)",
92
- "nodejs_interpreter_path": "/home/fanqifeng/.nvm/versions/node/v10.15.1/bin/node",
93
- "nodejs_package_manager_path": "npm",
94
- "settings.editor.selected.configurable": "settings.nodejs",
95
- "ts.external.directory.path": "/opt/WebStorm/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external",
96
- "vue.rearranger.settings.migration": "true"
80
+ <component name="PropertiesComponent">{
81
+ &quot;keyToString&quot;: {
82
+ &quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
83
+ &quot;Project.color&quot;: &quot;4c401d&quot;,
84
+ &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
85
+ &quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
86
+ &quot;git-widget-placeholder&quot;: &quot;master&quot;,
87
+ &quot;last_opened_file_path&quot;: &quot;/home/fanqifeng/WebstormProjects/kfb-view&quot;,
88
+ &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
89
+ &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
90
+ &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
91
+ &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
92
+ &quot;nodejs_interpreter_path&quot;: &quot;/home/fanqifeng/.nvm/versions/node/v10.15.1/bin/node&quot;,
93
+ &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
94
+ &quot;settings.editor.selected.configurable&quot;: &quot;settings.nodejs&quot;,
95
+ &quot;ts.external.directory.path&quot;: &quot;/opt/WebStorm/plugins/javascript-impl/jsLanguageServicesImpl/external&quot;,
96
+ &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
97
97
  }
98
- }]]></component>
98
+ }</component>
99
99
  <component name="RecentsManager">
100
100
  <key name="CopyFile.RECENT_KEYS">
101
+ <recent name="$PROJECT_DIR$/src/plugin/openseadragon" />
101
102
  <recent name="$PROJECT_DIR$/example" />
102
103
  <recent name="$PROJECT_DIR$/src/image" />
103
104
  <recent name="$PROJECT_DIR$/src/plugin" />
104
105
  <recent name="$PROJECT_DIR$/src/components/cache" />
105
- <recent name="$PROJECT_DIR$/src/components/rotation" />
106
106
  </key>
107
107
  <key name="MoveFile.RECENT_KEYS">
108
108
  <recent name="$PROJECT_DIR$/src/components/grid" />
@@ -389,84 +389,38 @@
389
389
  <workItem from="1671501857160" duration="90000" />
390
390
  <workItem from="1671751607914" duration="9693000" />
391
391
  <workItem from="1671762555964" duration="1197000" />
392
- <workItem from="1675327241367" duration="367000" />
393
- </task>
394
- <task id="LOCAL-00070" summary="标注时增加右键拖动视野">
395
- <created>1657537220254</created>
396
- <option name="number" value="00070" />
397
- <option name="presentableId" value="LOCAL-00070" />
398
- <option name="project" value="LOCAL" />
399
- <updated>1657537220255</updated>
400
- </task>
401
- <task id="LOCAL-00071" summary="曲线绘制中,按删除键,删除上一个标注点">
402
- <created>1657538768786</created>
403
- <option name="number" value="00071" />
404
- <option name="presentableId" value="LOCAL-00071" />
405
- <option name="project" value="LOCAL" />
406
- <updated>1657538768786</updated>
407
- </task>
408
- <task id="LOCAL-00072" summary="优化点击操作">
409
- <created>1657539785588</created>
410
- <option name="number" value="00072" />
411
- <option name="presentableId" value="LOCAL-00072" />
412
- <option name="project" value="LOCAL" />
413
- <updated>1657539785589</updated>
414
- </task>
415
- <task id="LOCAL-00073" summary="enableDbClickClose">
416
- <created>1657539900044</created>
417
- <option name="number" value="00073" />
418
- <option name="presentableId" value="LOCAL-00073" />
419
- <option name="project" value="LOCAL" />
420
- <updated>1657539900044</updated>
421
- </task>
422
- <task id="LOCAL-00074" summary="2.1.20">
423
- <created>1657539914133</created>
424
- <option name="number" value="00074" />
425
- <option name="presentableId" value="LOCAL-00074" />
426
- <option name="project" value="LOCAL" />
427
- <updated>1657539914133</updated>
428
- </task>
429
- <task id="LOCAL-00075" summary="view.js">
430
- <created>1657540107150</created>
431
- <option name="number" value="00075" />
432
- <option name="presentableId" value="LOCAL-00075" />
433
- <option name="project" value="LOCAL" />
434
- <updated>1657540107150</updated>
435
- </task>
436
- <task id="LOCAL-00076" summary="优化选中点">
437
- <created>1657588323251</created>
438
- <option name="number" value="00076" />
439
- <option name="presentableId" value="LOCAL-00076" />
440
- <option name="project" value="LOCAL" />
441
- <updated>1657588323252</updated>
442
- </task>
443
- <task id="LOCAL-00077" summary="优化标注图形显示,一次最多绘制5000个点,超过的标注延迟加载">
444
- <created>1657592781786</created>
445
- <option name="number" value="00077" />
446
- <option name="presentableId" value="LOCAL-00077" />
447
- <option name="project" value="LOCAL" />
448
- <updated>1657592781786</updated>
449
- </task>
450
- <task id="LOCAL-00078" summary="键盘事件更新,delete可删除曲线标注点,双击可添加曲线标注点">
451
- <created>1657607397044</created>
452
- <option name="number" value="00078" />
453
- <option name="presentableId" value="LOCAL-00078" />
454
- <option name="project" value="LOCAL" />
455
- <updated>1657607397044</updated>
456
- </task>
457
- <task id="LOCAL-00079" summary="2.20.0">
458
- <created>1657607434015</created>
459
- <option name="number" value="00079" />
460
- <option name="presentableId" value="LOCAL-00079" />
461
- <option name="project" value="LOCAL" />
462
- <updated>1657607434015</updated>
463
- </task>
464
- <task id="LOCAL-00080" summary="2.2.0">
465
- <created>1657607449348</created>
466
- <option name="number" value="00080" />
467
- <option name="presentableId" value="LOCAL-00080" />
468
- <option name="project" value="LOCAL" />
469
- <updated>1657607449348</updated>
392
+ <workItem from="1675327241367" duration="1458000" />
393
+ <workItem from="1675384282016" duration="594000" />
394
+ <workItem from="1675385204348" duration="1462000" />
395
+ <workItem from="1675843622628" duration="4524000" />
396
+ <workItem from="1675848342418" duration="2364000" />
397
+ <workItem from="1675902452322" duration="1711000" />
398
+ <workItem from="1675909040416" duration="1850000" />
399
+ <workItem from="1675923421168" duration="14000" />
400
+ <workItem from="1676430334861" duration="2002000" />
401
+ <workItem from="1676507825692" duration="1801000" />
402
+ <workItem from="1676515560281" duration="597000" />
403
+ <workItem from="1676530835986" duration="1197000" />
404
+ <workItem from="1676621760411" duration="596000" />
405
+ <workItem from="1676679228746" duration="561000" />
406
+ <workItem from="1676680577748" duration="1197000" />
407
+ <workItem from="1676690227544" duration="597000" />
408
+ <workItem from="1676722969064" duration="565000" />
409
+ <workItem from="1678926296962" duration="2385000" />
410
+ <workItem from="1679708561519" duration="550000" />
411
+ <workItem from="1679728741473" duration="161000" />
412
+ <workItem from="1680268962874" duration="1136000" />
413
+ <workItem from="1680271989452" duration="591000" />
414
+ <workItem from="1680437372638" duration="2994000" />
415
+ <workItem from="1680440411212" duration="49000" />
416
+ <workItem from="1680526343598" duration="1856000" />
417
+ <workItem from="1680595613024" duration="557000" />
418
+ <workItem from="1680596301151" duration="1804000" />
419
+ <workItem from="1680740253103" duration="572000" />
420
+ <workItem from="1680746491709" duration="597000" />
421
+ <workItem from="1680750141486" duration="416000" />
422
+ <workItem from="1680834237716" duration="2982000" />
423
+ <workItem from="1680858434486" duration="1053000" />
470
424
  </task>
471
425
  <task id="LOCAL-00081" summary="加载速度优化">
472
426
  <created>1657612318446</created>
@@ -734,7 +688,84 @@
734
688
  <option name="project" value="LOCAL" />
735
689
  <updated>1675327595052</updated>
736
690
  </task>
737
- <option name="localTasksCounter" value="119" />
691
+ <task id="LOCAL-00119" summary="2.4.1">
692
+ <created>1675327616880</created>
693
+ <option name="number" value="00119" />
694
+ <option name="presentableId" value="LOCAL-00119" />
695
+ <option name="project" value="LOCAL" />
696
+ <updated>1675327616880</updated>
697
+ </task>
698
+ <task id="LOCAL-00120" summary="升级openseadragon插件">
699
+ <created>1675919992646</created>
700
+ <option name="number" value="00120" />
701
+ <option name="presentableId" value="LOCAL-00120" />
702
+ <option name="project" value="LOCAL" />
703
+ <updated>1675919992646</updated>
704
+ </task>
705
+ <task id="LOCAL-00121" summary="feat:增加停止绘画事件">
706
+ <created>1678929016258</created>
707
+ <option name="number" value="00121" />
708
+ <option name="presentableId" value="LOCAL-00121" />
709
+ <option name="project" value="LOCAL" />
710
+ <updated>1678929016258</updated>
711
+ </task>
712
+ <task id="LOCAL-00122" summary="feat:截图生成的图片保留标注信息">
713
+ <created>1678929084617</created>
714
+ <option name="number" value="00122" />
715
+ <option name="presentableId" value="LOCAL-00122" />
716
+ <option name="project" value="LOCAL" />
717
+ <updated>1678929084617</updated>
718
+ </task>
719
+ <task id="LOCAL-00123" summary="build:3.0.1">
720
+ <created>1678929156803</created>
721
+ <option name="number" value="00123" />
722
+ <option name="presentableId" value="LOCAL-00123" />
723
+ <option name="project" value="LOCAL" />
724
+ <updated>1678929156803</updated>
725
+ </task>
726
+ <task id="LOCAL-00124" summary="build:3.0.2 截图图片格式自定义">
727
+ <created>1680269167145</created>
728
+ <option name="number" value="00124" />
729
+ <option name="presentableId" value="LOCAL-00124" />
730
+ <option name="project" value="LOCAL" />
731
+ <updated>1680269167145</updated>
732
+ </task>
733
+ <task id="LOCAL-00125" summary="build:3.0.3 截图支持设置分辨率,质量,格式">
734
+ <created>1680440104839</created>
735
+ <option name="number" value="00125" />
736
+ <option name="presentableId" value="LOCAL-00125" />
737
+ <option name="project" value="LOCAL" />
738
+ <updated>1680440104840</updated>
739
+ </task>
740
+ <task id="LOCAL-00126" summary="build:3.0.3导航图宽高限制">
741
+ <created>1680528157819</created>
742
+ <option name="number" value="00126" />
743
+ <option name="presentableId" value="LOCAL-00126" />
744
+ <option name="project" value="LOCAL" />
745
+ <updated>1680528157819</updated>
746
+ </task>
747
+ <task id="LOCAL-00127" summary="build:3.0.5 截图记录位置信息">
748
+ <created>1680847205108</created>
749
+ <option name="number" value="00127" />
750
+ <option name="presentableId" value="LOCAL-00127" />
751
+ <option name="project" value="LOCAL" />
752
+ <updated>1680847205108</updated>
753
+ </task>
754
+ <task id="LOCAL-00128" summary="build:3.0.6 修复填充图形绘制时显示异常">
755
+ <created>1680859251199</created>
756
+ <option name="number" value="00128" />
757
+ <option name="presentableId" value="LOCAL-00128" />
758
+ <option name="project" value="LOCAL" />
759
+ <updated>1680859251199</updated>
760
+ </task>
761
+ <task id="LOCAL-00129" summary="build:3.0.6 填充图形绘制时,内容偏移">
762
+ <created>1680859385125</created>
763
+ <option name="number" value="00129" />
764
+ <option name="presentableId" value="LOCAL-00129" />
765
+ <option name="project" value="LOCAL" />
766
+ <updated>1680859385125</updated>
767
+ </task>
768
+ <option name="localTasksCounter" value="130" />
738
769
  <servers />
739
770
  </component>
740
771
  <component name="TypeScriptGeneratedFilesManager">
@@ -747,6 +778,7 @@
747
778
  <option value="Default.Author" />
748
779
  <option value="Default.Date" />
749
780
  <option value="Default.Subject" />
781
+ <option value="Space.CommitStatus" />
750
782
  </list>
751
783
  </option>
752
784
  </component>
@@ -761,7 +793,7 @@
761
793
  <entry key="branch">
762
794
  <value>
763
795
  <list>
764
- <option value="master" />
796
+ <option value="origin/master" />
765
797
  </list>
766
798
  </value>
767
799
  </entry>
@@ -776,17 +808,6 @@
776
808
  <component name="VcsManagerConfiguration">
777
809
  <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
778
810
  <option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="false" />
779
- <MESSAGE value="2.2.5" />
780
- <MESSAGE value="2.2.8" />
781
- <MESSAGE value="优化标注信息显示" />
782
- <MESSAGE value="标注事件回调" />
783
- <MESSAGE value="defaultShow" />
784
- <MESSAGE value="2.2.9" />
785
- <MESSAGE value="矩形框的选中点变成线" />
786
- <MESSAGE value="2.3.0" />
787
- <MESSAGE value="矩形移动点默认隐藏,悬浮显示" />
788
- <MESSAGE value="label.model.js" />
789
- <MESSAGE value="解决反向绘制时,标注信息显示错误" />
790
811
  <MESSAGE value="2.3.1" />
791
812
  <MESSAGE value="优化渲染速度" />
792
813
  <MESSAGE value="2.3.2" />
@@ -801,7 +822,18 @@
801
822
  <MESSAGE value="2.4.0,绘制标注优化,一次只绘制2000个,分批绘制" />
802
823
  <MESSAGE value="截图区域范围数值保留2位小数" />
803
824
  <MESSAGE value="标注位置跳转增加参数,是否显示跳转动画" />
804
- <option name="LAST_COMMIT_MESSAGE" value="标注位置跳转增加参数,是否显示跳转动画" />
825
+ <MESSAGE value="2.4.1" />
826
+ <MESSAGE value="升级openseadragon插件" />
827
+ <MESSAGE value="feat:增加停止绘画事件" />
828
+ <MESSAGE value="feat:截图生成的图片保留标注信息" />
829
+ <MESSAGE value="build:3.0.1" />
830
+ <MESSAGE value="build:3.0.2 截图图片格式自定义" />
831
+ <MESSAGE value="build:3.0.3 截图支持设置分辨率,质量,格式" />
832
+ <MESSAGE value="build:3.0.3导航图宽高限制" />
833
+ <MESSAGE value="build:3.0.5 截图记录位置信息" />
834
+ <MESSAGE value="build:3.0.6 修复填充图形绘制时显示异常" />
835
+ <MESSAGE value="build:3.0.6 填充图形绘制时,内容偏移" />
836
+ <option name="LAST_COMMIT_MESSAGE" value="build:3.0.6 填充图形绘制时,内容偏移" />
805
837
  <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
806
838
  </component>
807
839
  <component name="XSLT-Support.FileAssociations.UIState">
@@ -66,8 +66,7 @@ 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',
70
- target: 'https://vai.hzztai.com',
69
+ target: 'http://192.168.1.16',
71
70
  // target: 'https://tct.hzztai.com',
72
71
  // target: 'https://pis-ningbo.hzztai.com',
73
72
  // target: 'https://pis-test.hzztai.com',
package/example/index.js CHANGED
@@ -25,12 +25,12 @@ deleteEmptyImg.src = deleteEmptySvg;
25
25
  const hasAuditImg = new Image();
26
26
  hasAuditImg.src = hasAuditSvg;
27
27
 
28
- const fileName = 'uploads/TCT/已入库/guangzhou_fuer_hospital/pos/labeling/LSIL/MY22004_other_2022-08-22_LSIL_切片2.kfb';
28
+ const fileName = '/uploads/TCT/已入库/ningbo_pathology_center/neg/labeling/WS/T2018-46374_ThinPrep_2018-08-31_WS.kfb';
29
29
 
30
30
  const instance = axios.create({
31
31
  baseURL: '/api',
32
32
  timeout: 1000,
33
- headers: {'Authorization': 'bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjIyL2FwaS9hdXRoL2xvZ2luIiwiaWF0IjoxNjY3NjE2OTIyLCJleHAiOjE2Njc2NTUzMjIsIm5iZiI6MTY2NzYxNjkyMiwianRpIjoiMDl4SEZMdlpHUlliVExlQyIsInN1YiI6MjcsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.buNwEIsNSqo1-wH8zEaRyjauIVKOXmjJfjaa1-g9l_k'},
33
+ headers: {'Authorization': 'bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjE2L2FwaS9hdXRoL2xvZ2luIiwiaWF0IjoxNjY2OTI2ODk1LCJleHAiOjE2NjY5NjUyOTUsIm5iZiI6MTY2NjkyNjg5NSwianRpIjoieU5mT3NXMmVraWs0RTUxayIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.2T7Xkx-5BhtR1HOc5FLbJIzDmgaq2bbCuXJoowUX0IE'},
34
34
  });
35
35
 
36
36
  let cacheImage = {};
@@ -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 || 1,
79
+ imageCapRes: data.imageCapRes,
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 = [];
@@ -304,6 +304,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
304
304
  kv.board.startDraw({
305
305
  tool: KfbView.marks.RECTANGLE,
306
306
  isROI: false,
307
+ once: true,
307
308
  measure: true,
308
309
  });
309
310
  };
@@ -372,9 +373,9 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
372
373
  console.log(e);
373
374
  });*/
374
375
  kv.$on(KfbView.events.EVENT_END_PAINTING, (e) => {
375
- console.time('appendLabelList');
376
- kv.appendLabelList([e.detail]);
377
- console.timeEnd('appendLabelList');
376
+ console.log(e.detail);
377
+ list.push(e.detail);
378
+ kv.initLabelList(list);
378
379
  // kv.board.endDraw();
379
380
  });
380
381
  kv.$on(KfbView.events.EVENT_DELETE_LABEL, (e) => {
@@ -412,111 +413,67 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
412
413
  }, 6000);
413
414
  }, 6000);
414
415
 
415
- initLabels();
416
+ // initLabels();
416
417
 
417
418
  function initLabels() {
418
419
  const labels = [];
419
- const colors = ['#027AFF', '#f56c6c', '#11ff6c', '#f56cff', '#11ffff'];
420
- for (let i = 0; i < 10000; i++) {
420
+ const colors = ['#027AFF', '#f56c6c'];
421
+ for (let i = 0; i < 50000; i++) {
421
422
  const point = {
422
423
  x: Math.random() * data.width,
423
424
  y: Math.random() * data.height,
424
425
  };
425
- const point1 = {
426
- x: point.x + Math.random() * 1000,
427
- y: point.y + Math.random() * 1000,
428
- };
429
426
  const label = {
430
427
  // fillStyle: 'rgba(2, 122, 255, 1)',
431
- lineWidth: 2,
432
- points: [point, point1],
428
+ lineWidth: 6,
429
+ points: [point, point],
433
430
  scale: 0.1,
434
- strokeStyle: colors[(Math.random() * colors.length) >> 0],
435
- tool: 'Rectangle',
436
- move: true,
437
- resize: true,
431
+ strokeStyle: Math.random() > .5 ? colors[0] : colors[1],
432
+ tool: 'Dot',
433
+ move: false,
438
434
  };
439
435
  labels.push(label);
440
436
  }
441
437
  kv.initLabelList(labels);
442
438
  }
443
439
 
444
- /*
445
- instance.get(
446
- `/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
447
- then(({data}) => {
448
- data = data.data;
449
- const labelRegionList = [];
450
- (data || []).filter(item => item.id && item.region.width > 0).
451
- forEach(item => {
452
- const subClass = item.sub_class || item.subClass;
453
- const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
454
- const r = {
455
- ...item,
456
- tool: (item.type || item.tool) === 'Spline' ?
457
- 'Polygon' :
458
- (item.type || item.tool),
459
- strokeStyle: item.strokeStyle || `#${item.color.toString(16).
460
- slice(2)}${item.color.toString(16).slice(0, 2)}`,
461
- measure: true,
462
- sub_class: subClass,
463
- isROI: subClass === 'ROI',
464
- isClose: item.isClose || item.is_close,
465
- lineWidth: item.lineWidth || item.width,
466
- text: item.text || item.description,
467
- is_ai,
468
- ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
469
- ai_points: is_ai ? (item.ai_points ?? item.points) : '',
470
- ai_region: is_ai ? (item.ai_region ?? item.region) : '',
471
- };
472
- r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
473
- labelRegionList.push({
474
- ...r,
475
- });
440
+ instance.get(
441
+ `/image_annotation?file=${fileName}&slide_label_id=48010&user_id=1`).
442
+ then(({data}) => {
443
+ data = data.data;
444
+ const labelRegionList = [];
445
+ (data || []).filter(item => item.id && item.region.width > 0).
446
+ forEach(item => {
447
+ const subClass = item.sub_class || item.subClass;
448
+ const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
449
+ const r = {
450
+ ...item,
451
+ tool: (item.type || item.tool) === 'Spline' ?
452
+ 'Polygon' :
453
+ (item.type || item.tool),
454
+ strokeStyle: `#${item.color.toString(16).
455
+ slice(2)}${item.color.toString(16).slice(0, 2)}`,
456
+ measure: true,
457
+ sub_class: subClass,
458
+ isROI: subClass === 'ROI',
459
+ isClose: item.isClose || item.is_close,
460
+ lineWidth: item.lineWidth || item.width,
461
+ text: item.text || item.description,
462
+ is_ai,
463
+ ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
464
+ ai_points: is_ai ? (item.ai_points ?? item.points) : '',
465
+ ai_region: is_ai ? (item.ai_region ?? item.region) : '',
466
+ };
467
+ r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
468
+ labelRegionList.push({
469
+ ...r,
476
470
  });
477
- console.time('initLabelList');
478
- kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
479
- console.timeEnd('initLabelList');
480
- });
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
471
  });
519
- });*/
472
+ kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
473
+ });
474
+ document.querySelector('#reDraw').addEventListener('click', () => {
475
+ initLabels();
476
+ });
520
477
  });
521
478
 
522
479
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kfb-view",
3
3
  "description": "一个在线kfb的阅片软件",
4
- "version": "2.4.1",
4
+ "version": "2.4.2",
5
5
  "author": "qifeng.fan <qifeng.fan@hzztai.com>",
6
6
  "license": "MIT",
7
7
  "main": "lib/kfb-view.js",
@@ -168,10 +168,10 @@ export class Shape extends ViewerCommon {
168
168
  regionLabelList.forEach((item) => {
169
169
  this.combination.setContent(this.canvas, item);
170
170
  this.combination.draw({
171
- points: item.viewerElementPoints,
171
+ points: this.imageToViewerElementPoints(item.points),
172
172
  tool: item.tool,
173
- }, item.child.map(({viewerElementPoints, tool}) => ({
174
- points: viewerElementPoints,
173
+ }, item.child.map(({points, tool}) => ({
174
+ points: this.imageToViewerElementPoints(points),
175
175
  tool,
176
176
  })), this.viewport.getRotation());
177
177
  });