hellfire 0.25.0 → 0.25.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.25.2](http://10.16.100.57/diffusion/115/paladin/compare/v0.25.1...v0.25.2) (2023-01-13)
6
+
7
+
8
+
9
+ ## [0.25.1](http://10.16.100.57/diffusion/115/paladin/compare/v0.25.0...v0.25.1) (2023-01-13)
10
+
11
+
12
+
5
13
  # [0.25.0](http://10.16.100.57/diffusion/115/paladin/compare/v0.24.1...v0.25.0) (2022-09-29)
6
14
 
7
15
 
package/README.md CHANGED
@@ -1,28 +1,32 @@
1
- ### Paladin
1
+ ### Paladin (hellfire)
2
2
  ---
3
3
 
4
- 承泽本地渲染引擎
4
+ 云图本地渲染引擎
5
5
 
6
6
  ### Usage
7
7
 
8
8
  Example:
9
9
 
10
10
  ```
11
- import DicomView from 'paladin';
11
+ import DicomView from 'hellfire';
12
12
  const Example = ()=> (
13
13
  <DicomView
14
+ ref='dicomViewLocal'
14
15
  study={study}
16
+ token={token}
15
17
  options={options}
16
18
  toolSortChange={this.toolSortChange}
19
+ ...
17
20
  />
18
21
  )
19
22
  ```
20
23
 
21
24
  ### API documentation
22
25
 
23
- Paladin允许传入参数为 `study`, `options`, `toolSortChange`
26
+ > 1.DicomView允许传入的参数
24
27
 
25
28
  <b>`study`</b>
29
+
26
30
  ```
27
31
  [
28
32
  {
@@ -38,9 +42,11 @@ Paladin允许传入参数为 `study`, `options`, `toolSortChange`
38
42
  }
39
43
  ]
40
44
  ```
45
+
41
46
  需要按此格式传入的检查相关数据集
42
47
 
43
48
  <b>`options`</b>
49
+
44
50
  ```
45
51
  {
46
52
  layout: {
@@ -51,15 +57,129 @@ Paladin允许传入参数为 `study`, `options`, `toolSortChange`
51
57
  toolbarSize: 20
52
58
  }
53
59
  ```
54
- 传入配置项,控制布局和工具栏等
60
+
61
+ 传入配置项,控制布局和工具栏等(用于早期的单列工具栏)
55
62
 
56
63
  - <b>layout</b> :传入初始化布局,不传则默认2*2
57
64
  - <b>tools</b> :传入初始化工具栏顺序
58
65
  - <b>toolbarSize</b> :传入初始化工具栏图标大小
59
66
 
67
+ <b>`helpLink`</b>
68
+
69
+ ```
70
+ helpLink = {'http://www.baidu.com'}
71
+ ```
72
+
73
+ 工具栏"使用帮助"跳转的链接
74
+
75
+ <b>`aiResult`</b>
76
+
77
+ ```
78
+ aiResult = {}
79
+ ```
80
+
81
+ ai结果在影像上打的标记
82
+
83
+ <b>`showAIResult`</b>
84
+
85
+ ```
86
+ showAIResult: boolean
87
+ ```
88
+
89
+ 是否在影像上显示ai结果标记
90
+
91
+ <b>`windowSetting`</b>
92
+
93
+ ```
94
+ windowSetting = {}
95
+ ```
96
+
97
+ 初始化窗值的配置
98
+
99
+ <b>`onLoadReady`</b>
100
+
101
+ ```
102
+ onLoadReady: ()=> void
103
+ ```
104
+
105
+ 所有序列图像加载完毕触发
106
+
107
+ <b>`changeWindowSet`</b>
108
+
109
+ ```
110
+ changeWindowSet: (key, body, index)=> void
111
+ ```
112
+
113
+ 触发自定义窗值 key有:add update delete
114
+
115
+ <b>`operateServerToolState`</b>
116
+
117
+ ```
118
+ operateServerToolState: (key, data) => void
119
+ ```
120
+
121
+ 触发测量工具保存 key有:save delete clear
122
+
123
+ <b>`operateCentesisPath`</b>
124
+
125
+ ```
126
+ operateCentesisPath: (key, data) => void
127
+ ```
128
+
129
+ 触发手术路径规划数据的保存 key有:save
130
+
131
+ <b>`onRefresh`</b>
132
+
133
+ ```
134
+ onRefresh: () => void
135
+ ```
136
+
137
+ 界面下方的重新加载触发的方法(在reload之前)
138
+
60
139
  <b>`toolSortChange`</b>
140
+
61
141
  ```
62
142
  toolSortChange: ()=> void
63
143
  ```
64
- 传入工具栏自定义排序的回调函数
144
+
145
+ 传入工具栏自定义排序的回调函数(用于早期的单列工具栏)
146
+
147
+ > 2.DicomView提供给父组件调用的方法
148
+
149
+ <b>`addStudy(data)`</b>
150
+
151
+ 添加序列,data格式参考study
152
+
153
+ <b>`scrollSeriesImageToIndex(SeriesInstanceUID, SOPInstanceUID)`</b>
154
+
155
+ 指定某个序列跳转到某个图像上
156
+
157
+ <b>`emitImageResize()`</b>
158
+
159
+ 视窗大小的改变
160
+
161
+ <b>`cornerstoneActionEmit({type:xxx,data:xxx})`</b>
162
+
163
+ 模拟触发paladin内的各种操作行为(提供给同屏使用)
164
+
165
+ > 3.paladin对外暴露的对象
166
+
167
+ 用法:
168
+ ```
169
+ import { reducers as hellfireReducer, paladinUtils} from 'hellfire'
170
+ ```
171
+
172
+ <b>`reducers`</b>
173
+
174
+ 暴露给外部hellfire的redux数据
175
+
176
+ <b>`paladinUtils`</b>
177
+
178
+ - getMultiImageDataFromWodo:将wodo url生成base64的image数据
179
+ ```
180
+ paladinUtils.getMultiImageDataFromWodo({
181
+ wodoList
182
+ })
183
+ ```
184
+
65
185
 
package/dist/index.js CHANGED
@@ -32528,14 +32528,14 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32528
32528
  };
32529
32529
  _this = _super.call(this, props, defaultProps);
32530
32530
  _this.aiResult = get$1('aiResult');
32531
- _this.color = '#ffff00';
32531
+ _this.color = '#faa80a';
32532
32532
  return _this;
32533
32533
  }
32534
32534
 
32535
32535
  createClass(AIAnalysisOverlayTool, [{
32536
32536
  key: "addMeasurement",
32537
- value: function addMeasurement(data, element) {
32538
- var measurementData = this.createNewMeasurement(data);
32537
+ value: function addMeasurement(data, element, imagePlane, index) {
32538
+ var measurementData = this.createNewMeasurement(data, imagePlane, index);
32539
32539
  addToolState$5(element, this.name, measurementData);
32540
32540
  external$t.cornerstone.updateImage(element);
32541
32541
  }
@@ -32552,7 +32552,7 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32552
32552
  }
32553
32553
  }, {
32554
32554
  key: "createNewMeasurement",
32555
- value: function createNewMeasurement(data) {
32555
+ value: function createNewMeasurement(data, imagePlane, index) {
32556
32556
  var edgePoints = data.edgePoints;
32557
32557
 
32558
32558
  if (!edgePoints) {
@@ -32585,7 +32585,22 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32585
32585
  coords.y = end.y;
32586
32586
  }
32587
32587
 
32588
+ var columns = imagePlane.columns,
32589
+ rows = imagePlane.rows;
32588
32590
  var text = getAIText(data);
32591
+ var textBoxX = coords.x;
32592
+ var textBoxY = coords.y;
32593
+
32594
+ if (index === 0) {
32595
+ textBoxX = 20;
32596
+ textBoxY = columns - 50;
32597
+ }
32598
+
32599
+ if (index === 1) {
32600
+ textBoxX = rows - 20;
32601
+ textBoxY = columns - 50;
32602
+ }
32603
+
32589
32604
  return {
32590
32605
  visible: true,
32591
32606
  active: false,
@@ -32597,11 +32612,11 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32597
32612
  start2: start2,
32598
32613
  end2: end2,
32599
32614
  textBox: {
32600
- x: coords.x,
32601
- y: coords.y,
32615
+ x: textBoxX,
32616
+ y: textBoxY,
32602
32617
  text: text,
32603
32618
  active: false,
32604
- hasMoved: false,
32619
+ hasMoved: true,
32605
32620
  movesIndependently: false,
32606
32621
  drawnIndependently: true,
32607
32622
  allowedOutsideImage: true,
@@ -32648,7 +32663,7 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32648
32663
  var _renderToolData = asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(evt) {
32649
32664
  var _this2 = this;
32650
32665
 
32651
- var eventData, element, toolData, stack, seriesInstanceUID, dicom, instanceNumber, aiData, drawData, context, lineWidth, i, data, xOffset;
32666
+ var eventData, element, toolData, stack, imagePlane, seriesInstanceUID, dicom, instanceNumber, aiData, drawData, context, lineWidth, i, data, xOffset;
32652
32667
  return regenerator.wrap(function _callee$(_context) {
32653
32668
  while (1) {
32654
32669
  switch (_context.prev = _context.next) {
@@ -32667,7 +32682,7 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32667
32682
  toolData = cornerstoneTools.getToolState(evt.currentTarget, this.name);
32668
32683
 
32669
32684
  if (toolData) {
32670
- _context.next = 19;
32685
+ _context.next = 20;
32671
32686
  break;
32672
32687
  }
32673
32688
 
@@ -32682,11 +32697,12 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32682
32697
  return _context.abrupt("return");
32683
32698
 
32684
32699
  case 9:
32700
+ imagePlane = external$t.cornerstone.metaData.get('imagePlaneModule', eventData.image.imageId);
32685
32701
  seriesInstanceUID = stack.data[0].seriesInstanceUID;
32686
- _context.next = 12;
32702
+ _context.next = 13;
32687
32703
  return loadAndCacheDicom(eventData.image.imageId);
32688
32704
 
32689
- case 12:
32705
+ case 13:
32690
32706
  dicom = _context.sent;
32691
32707
  instanceNumber = lodash$1.toNumber(dicom.InstanceNumber.value);
32692
32708
  aiData = [];
@@ -32712,16 +32728,16 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32712
32728
  });
32713
32729
 
32714
32730
  if (drawData && drawData.length > 0) {
32715
- lodash$1.forEach(drawData, function (data) {
32716
- _this2.addMeasurement(data, element);
32731
+ lodash$1.forEach(drawData, function (data, i) {
32732
+ _this2.addMeasurement(data, element, imagePlane, i);
32717
32733
  });
32718
32734
  }
32719
32735
  }
32720
32736
 
32721
- _context.next = 22;
32737
+ _context.next = 23;
32722
32738
  break;
32723
32739
 
32724
- case 19:
32740
+ case 20:
32725
32741
  // 绘制
32726
32742
  context = getNewContext$g(eventData.canvasContext.canvas);
32727
32743
  lineWidth = cornerstoneTools.toolStyle.getToolWidth();
@@ -32737,7 +32753,7 @@ var AIAnalysisOverlayTool = /*#__PURE__*/function (_BaseAnnotationPlusTo) {
32737
32753
  drawLinkedTextBox$8(context, element, data.handles.textBox, data.handles.textBox.text, data.handles, textBoxAnchorPoints, this.color, lineWidth, xOffset, true);
32738
32754
  }
32739
32755
 
32740
- case 22:
32756
+ case 23:
32741
32757
  case "end":
32742
32758
  return _context.stop();
32743
32759
  }
@@ -51935,6 +51951,7 @@ var DicomThumbnailLayout = /*#__PURE__*/function (_Component) {
51935
51951
 
51936
51952
  defineProperty(assertThisInitialized(_this), "handleRefresh", function () {
51937
51953
  paladinRefreshEvent();
51954
+ _this.props.onRefresh && _this.props.onRefresh();
51938
51955
  window.location.reload();
51939
51956
  });
51940
51957
 
@@ -52587,7 +52604,7 @@ var ViewportOverlay = /*#__PURE__*/function (_PureComponent) {
52587
52604
  var patientAge = dicom.PatientAge.toString();
52588
52605
  var patientID = dicom.PatientID.toString();
52589
52606
  var bodyPartExamined = dicom.BodyPartExamined.toString();
52590
- var laterality = dicom.Laterality.toString() || ''; //左下
52607
+ var laterality = dicom.Laterality.toString() || dicom.ImageLaterality.toString() || ''; //左下
52591
52608
 
52592
52609
  var patientOrientation = dicom.PatientOrientation.toString();
52593
52610
  var protocolName = dicom.ProtocolName.toString();
@@ -59844,7 +59861,8 @@ var DicomView = /*#__PURE__*/function (_Component) {
59844
59861
  var isMobile = _default$3.isDeviceTypeMobile();
59845
59862
  var _this$props5 = this.props,
59846
59863
  viewMode = _this$props5.viewMode,
59847
- toolMode = _this$props5.toolMode;
59864
+ toolMode = _this$props5.toolMode,
59865
+ onRefresh = _this$props5.onRefresh;
59848
59866
  var dcStyle = {
59849
59867
  display: 'flex',
59850
59868
  position: 'absolute',
@@ -59880,7 +59898,8 @@ var DicomView = /*#__PURE__*/function (_Component) {
59880
59898
  className: "paladin-dicomView-dicomThumbnailWrapper"
59881
59899
  }, /*#__PURE__*/React__default.createElement(_default$14, {
59882
59900
  isMobile: isMobile,
59883
- study: this.state.study
59901
+ study: this.state.study,
59902
+ onRefresh: onRefresh
59884
59903
  }));
59885
59904
  var mobile = /*#__PURE__*/React__default.createElement("div", {
59886
59905
  style: dcStyle
@@ -59975,6 +59994,7 @@ var __signature__$3A = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoa
59975
59994
  return a;
59976
59995
  };
59977
59996
  var scroll = _default$E.importInternal('util/scroll');
59997
+ var throttle$9 = _default$E.importInternal('util/throttle');
59978
59998
 
59979
59999
  var mapStateToProps$q = function mapStateToProps(state) {
59980
60000
  var _state$paladin$viewpo = state.paladin.viewport,
@@ -60084,6 +60104,39 @@ var mergeProps$p = function mergeProps(propsFromState, propsFromDispatch, ownPro
60084
60104
  var getCurrentElement = function getCurrentElement() {
60085
60105
  return getActiveElement(mode, activeIndex, imageActiveIndex, threeDMode, mprActiveIndex, Surgery, surgeryActiveIndex, CPR);
60086
60106
  };
60107
+ /**
60108
+ * 前进、后退快捷键,加入频率控制
60109
+ * 频率依据序列数量决定
60110
+ * 目前按照一个序列10s播完的标准来计算
60111
+ */
60112
+
60113
+
60114
+ var forwardFunc = function forwardFunc() {
60115
+ var activeElement = getCurrentElement();
60116
+ if (!activeElement) return;
60117
+
60118
+ if (threeDMode) {
60119
+ changeMprPositionWithElement(activeElement, -1, threeScrollType);
60120
+ } else {
60121
+ scroll(activeElement, -1, true, true);
60122
+ }
60123
+ };
60124
+
60125
+ var backFunc = function backFunc() {
60126
+ var activeElement = getCurrentElement();
60127
+ if (!activeElement) return;
60128
+
60129
+ if (threeDMode) {
60130
+ changeMprPositionWithElement(activeElement, 1, threeScrollType);
60131
+ } else {
60132
+ scroll(activeElement, 1, true, true);
60133
+ }
60134
+ };
60135
+
60136
+ var totalCount = propsFromState.currentSeries && propsFromState.currentSeries.imageIds.length || 0;
60137
+ var stepTime = lodash$1.floor(10 * 1000 / totalCount);
60138
+ var throttleForwardFunc = throttle$9(forwardFunc, stepTime);
60139
+ var throttleBackFunc = throttle$9(backFunc, stepTime);
60087
60140
  /**
60088
60141
  *
60089
60142
  * Key values:
@@ -60092,7 +60145,6 @@ var mergeProps$p = function mergeProps(propsFromState, propsFromDispatch, ownPro
60092
60145
  *
60093
60146
  */
60094
60147
 
60095
-
60096
60148
  return _objectSpread$N(_objectSpread$N(_objectSpread$N({}, ownProps), propsFromState), {}, {
60097
60149
  showDicomThumbnail: showDicomThumbnail,
60098
60150
  viewMode: viewMode,
@@ -60205,24 +60257,10 @@ var mergeProps$p = function mergeProps(propsFromState, propsFromDispatch, ownPro
60205
60257
  }
60206
60258
  },
60207
60259
  FORWARD: function FORWARD() {
60208
- var activeElement = getCurrentElement();
60209
- if (!activeElement) return;
60210
-
60211
- if (threeDMode) {
60212
- changeMprPositionWithElement(activeElement, -1, threeScrollType);
60213
- } else {
60214
- scroll(activeElement, -1, true, true);
60215
- }
60260
+ throttleForwardFunc();
60216
60261
  },
60217
60262
  BACKWARD: function BACKWARD() {
60218
- var activeElement = getCurrentElement();
60219
- if (!activeElement) return;
60220
-
60221
- if (threeDMode) {
60222
- changeMprPositionWithElement(activeElement, 1, threeScrollType);
60223
- } else {
60224
- scroll(activeElement, 1, true, true);
60225
- }
60263
+ throttleBackFunc();
60226
60264
  },
60227
60265
  SCALE_ADD: function SCALE_ADD() {
60228
60266
  setScaleRelative(getCurrentElement(), 1.1);
@@ -60699,6 +60737,7 @@ var _default$1g = ConnectedDicomView;
60699
60737
  }
60700
60738
 
60701
60739
  reactHotLoader.register(scroll, "scroll", "/Users/huyeqing/workspace/chainz/paladin/src/Viewer/DicomView/ConnectedDicomView.js");
60740
+ reactHotLoader.register(throttle$9, "throttle", "/Users/huyeqing/workspace/chainz/paladin/src/Viewer/DicomView/ConnectedDicomView.js");
60702
60741
  reactHotLoader.register(mapStateToProps$q, "mapStateToProps", "/Users/huyeqing/workspace/chainz/paladin/src/Viewer/DicomView/ConnectedDicomView.js");
60703
60742
  reactHotLoader.register(mergeProps$p, "mergeProps", "/Users/huyeqing/workspace/chainz/paladin/src/Viewer/DicomView/ConnectedDicomView.js");
60704
60743
  reactHotLoader.register(ConnectedDicomView, "ConnectedDicomView", "/Users/huyeqing/workspace/chainz/paladin/src/Viewer/DicomView/ConnectedDicomView.js");