hellfire 0.29.16 → 0.29.17

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,10 @@
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.29.17](http://10.16.100.57/diffusion/115/paladin/compare/v0.29.16...v0.29.17) (2025-06-09)
6
+
7
+
8
+
5
9
  ## [0.29.16](http://10.16.100.57/diffusion/115/paladin/compare/v0.29.15...v0.29.16) (2025-06-07)
6
10
 
7
11
 
package/dist/index.js CHANGED
@@ -554,6 +554,7 @@ var CustomKeyCodes = {
554
554
  69: 'key-e',
555
555
  70: 'key-f',
556
556
  74: 'key-j',
557
+ 75: 'key-k',
557
558
  76: 'key-l',
558
559
  80: 'key-p',
559
560
  82: 'key-r',
@@ -13807,6 +13808,24 @@ function guid() {
13807
13808
  return v.toString(16);
13808
13809
  });
13809
13810
  }
13811
+ function getScaledCanvasDat(originalCanvas) {
13812
+ var originWidth = originalCanvas.width;
13813
+ var originHeight = originalCanvas.height;
13814
+ var height = 300;
13815
+
13816
+ if (originHeight > height) {
13817
+ var ratio = height / originHeight;
13818
+ var tempCanvas = document.createElement('canvas');
13819
+ var tempCtx = tempCanvas.getContext('2d');
13820
+ tempCanvas.width = originWidth * ratio;
13821
+ tempCanvas.height = originHeight * ratio;
13822
+ tempCtx.imageSmoothingQuality = 'high';
13823
+ tempCtx.drawImage(originalCanvas, 0, 0, originalCanvas.width, originalCanvas.height, 0, 0, tempCanvas.width, tempCanvas.height);
13824
+ return tempCanvas.toDataURL('image/jpeg');
13825
+ } else {
13826
+ return originalCanvas.toDataURL('image/jpeg');
13827
+ }
13828
+ }
13810
13829
 
13811
13830
  /**
13812
13831
  * @class 手术路径,路径为直线段
@@ -25605,6 +25624,10 @@ var dicomSettingHotKeyDic = [{
25605
25624
  label: '显示/隐藏图像信息',
25606
25625
  label_en: 'Display/Hide Image Overlay',
25607
25626
  hotkey: 'T'
25627
+ }, {
25628
+ label: '添加/移除关键图',
25629
+ label_en: 'Add/Remove Key Image',
25630
+ hotkey: 'K'
25608
25631
  }];
25609
25632
  var hotKeyIsOpen = window.localStorage.getItem('hellfire-hotkey-open') || 'open';
25610
25633
  var dicomBasicInfoFrom = window.localStorage.getItem('hellfire-dicom-basic-info-from') || 'dicom';
@@ -47274,7 +47297,7 @@ var mergeProps$j = function mergeProps(propsFromState, propsFromDispatch, ownPro
47274
47297
 
47275
47298
  var ConnectedVRClip = reactRedux.connect(mapStateToProps$j, {}, mergeProps$j)(VRClip);
47276
47299
 
47277
- var css_248z$r = ".paladin-key-image-box {\n background: #fff;\n border-radius: 3px;\n}\n.paladin-key-image-box .paladin-key-image-header {\n font-size: 15px;\n font-weight: bold;\n color: #000;\n padding: 16px 18px;\n}\n.paladin-key-image-box .paladin-key-image-item {\n min-width: 320px;\n font-size: 13px;\n color: #333;\n padding: 14px 18px;\n}\n.paladin-key-image-box .paladin-key-image-item:nth-child(2n) {\n background: #f9f9f9;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action {\n text-align: right;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action span {\n display: inline-block;\n color: #2D78C4;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action span:first-child {\n margin-right: 20px;\n}\n.paladin-key-image-preview img {\n max-width: 100%;\n}\n";
47300
+ var css_248z$r = ".paladin-key-image-box {\n background: #fff;\n border-radius: 3px;\n}\n.paladin-key-image-box .paladin-key-image-header {\n font-size: 15px;\n font-weight: bold;\n color: #000;\n padding: 16px 18px;\n}\n.paladin-key-image-box .paladin-key-image-item {\n min-width: 320px;\n font-size: 13px;\n color: #333;\n padding: 14px 18px;\n}\n.paladin-key-image-box .paladin-key-image-item:nth-child(2n) {\n background: #f9f9f9;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action {\n text-align: right;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action span {\n display: inline-block;\n color: #2D78C4;\n}\n.paladin-key-image-box .paladin-key-image-item .paladin-key-image-item-action span:first-child {\n margin-right: 20px;\n}\n.paladin-key-image-preview img {\n max-width: 50vw;\n max-height: 50vh;\n}\n";
47278
47301
  styleInject$1(css_248z$r);
47279
47302
 
47280
47303
  function _createSuper$1o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1o(); return function _createSuperInternal() { var Super = getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn(this, result); }; }
@@ -47307,6 +47330,7 @@ var KeyImagesTool = /*#__PURE__*/function (_Component) {
47307
47330
  show: false
47308
47331
  },
47309
47332
  style: {
47333
+ width: '60%',
47310
47334
  textAlign: 'center'
47311
47335
  }
47312
47336
  });
@@ -50545,7 +50569,7 @@ var mergeProps$o = function mergeProps(propsFromState, propsFromDispatch, ownPro
50545
50569
  numberOfInstances: currentSeries.imageIds.length,
50546
50570
  instanceNumber: instanceNumber
50547
50571
  };
50548
- dataUrl = enabled.canvas.toDataURL('image/jpeg');
50572
+ dataUrl = getScaledCanvasDat(enabled.canvas);
50549
50573
  ownProps.operateKeyImages('add', {
50550
50574
  dataUrl: dataUrl,
50551
50575
  imageInfo: imageInfo
@@ -73645,7 +73669,8 @@ var mapStateToProps$F = function mapStateToProps(state) {
73645
73669
  MIP = _state$paladin$tools$2.MIP,
73646
73670
  CPR = _state$paladin$tools$2.CPR,
73647
73671
  Film = _state$paladin$tools$2.Film,
73648
- Fusion = _state$paladin$tools$2.Fusion;
73672
+ Fusion = _state$paladin$tools$2.Fusion,
73673
+ keyImages = _state$paladin$tools$2.keyImages;
73649
73674
  var _state$paladin$tools$3 = state.paladin.tools.customization,
73650
73675
  toolMode = _state$paladin$tools$3.toolMode,
73651
73676
  globalLoading = _state$paladin$tools$3.globalLoading;
@@ -73685,7 +73710,8 @@ var mapStateToProps$F = function mapStateToProps(state) {
73685
73710
  Film: Film,
73686
73711
  reduxFilmPrinterSettings: filmPrinterSettings,
73687
73712
  Fusion: Fusion,
73688
- fusionActiveIndex: fusionActiveIndex
73713
+ fusionActiveIndex: fusionActiveIndex,
73714
+ reduxKeyImages: keyImages
73689
73715
  };
73690
73716
  };
73691
73717
 
@@ -73824,10 +73850,87 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
73824
73850
  KEYE: ['key-e'],
73825
73851
  KEYR: ['key-r'],
73826
73852
  KEYT: ['key-t'],
73853
+ KEYK: ['key-k'],
73827
73854
  DICOMMODAL: ['ctrl+alt+key-d'] // FILMENTRANCE: ['ctrl+alt+key-p', 'ctrl+alt+key-f']
73828
73855
 
73829
73856
  },
73830
73857
  handlers: {
73858
+ KEYK: function KEYK() {
73859
+ // 添加删除关键图
73860
+ if (!hotKeyIsOpen) {
73861
+ return;
73862
+ } // 关键图像添加/移除
73863
+
73864
+
73865
+ var reduxKeyImages = propsFromState.reduxKeyImages,
73866
+ seriesCurrentIndex = propsFromState.seriesCurrentIndex,
73867
+ currentSeries = propsFromState.currentSeries;
73868
+ var realActiveIndex = col * currentScrollLine + activeIndex;
73869
+ var currentSeriesIndex = seriesCurrentIndex[realActiveIndex];
73870
+ var SOPInstanceUID = currentSeries.SOPInstanceUIDs[currentSeriesIndex];
73871
+ var selectImage = lodash$1.find(reduxKeyImages, {
73872
+ SOPInstanceUID: SOPInstanceUID
73873
+ });
73874
+
73875
+ function handleAddKeyImage() {
73876
+ return _handleAddKeyImage.apply(this, arguments);
73877
+ }
73878
+
73879
+ function _handleAddKeyImage() {
73880
+ _handleAddKeyImage = asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
73881
+ var activeElement, enabled, dicom, instanceNumber, imageInfo, dataUrl;
73882
+ return regenerator.wrap(function _callee$(_context) {
73883
+ while (1) {
73884
+ switch (_context.prev = _context.next) {
73885
+ case 0:
73886
+ activeElement = getElement(realActiveIndex);
73887
+ enabled = cornerstone.getEnabledElement(activeElement);
73888
+ _context.next = 4;
73889
+ return loadAndCacheDicom(enabled.image.imageId);
73890
+
73891
+ case 4:
73892
+ dicom = _context.sent;
73893
+
73894
+ if (dicom) {
73895
+ _context.next = 7;
73896
+ break;
73897
+ }
73898
+
73899
+ return _context.abrupt("return");
73900
+
73901
+ case 7:
73902
+ instanceNumber = dicom.InstanceNumber.toString();
73903
+ imageInfo = {
73904
+ studyInstanceUID: currentSeries.studyInstanceUID,
73905
+ seriesInstanceUID: currentSeries.seriesInstanceUID,
73906
+ SOPInstanceUID: SOPInstanceUID,
73907
+ seriesNumber: currentSeries.seriesNumber,
73908
+ numberOfSeries: currentSeries.seriesCount,
73909
+ numberOfInstances: currentSeries.imageIds.length,
73910
+ instanceNumber: instanceNumber
73911
+ };
73912
+ dataUrl = getScaledCanvasDat(enabled.canvas);
73913
+ ownProps.operateKeyImages('add', {
73914
+ dataUrl: dataUrl,
73915
+ imageInfo: imageInfo
73916
+ });
73917
+
73918
+ case 11:
73919
+ case "end":
73920
+ return _context.stop();
73921
+ }
73922
+ }
73923
+ }, _callee);
73924
+ }));
73925
+ return _handleAddKeyImage.apply(this, arguments);
73926
+ }
73927
+
73928
+ if (selectImage) {
73929
+ ownProps.operateKeyImages('remove', selectImage);
73930
+ } else {
73931
+ handleAddKeyImage();
73932
+ }
73933
+ },
73831
73934
  PAUSE: function PAUSE() {
73832
73935
  // 空格键的监听 如果正在播放 则暂停
73833
73936
  if (Cine) {
@@ -74295,12 +74398,12 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74295
74398
  });
74296
74399
  },
74297
74400
  initSeries: function () {
74298
- var _initSeries2 = asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(changeStudy, callback) {
74401
+ var _initSeries2 = asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(changeStudy, callback) {
74299
74402
  var data, resetToolMergeState, synchronizer, linkSynchronizer, linkImageModeSynchronizer, linkScrollSynchronizer, options, _study, series, needCheckMultiFrame, hasMultiFrame, modalitiesInStudy, i, item, wado, url, dataSet, numFrames, imageIds, _i, imageId, seriesCurrentIndex, firstReady, maxRequest, retry, clearCacheEveryLoad, dicom, frameTime, linkToolLocalDefaultState, realActiveIndex, continuousMeasureLocalDefaultState, referenceLineLocalDefaultState, shutterLocalDefaultState, autoLinkSyncWindowLevelDefaultState, autoLinkSyncOtherDefaultState, mprCrossModeDefaultState;
74300
74403
 
74301
- return regenerator.wrap(function _callee$(_context) {
74404
+ return regenerator.wrap(function _callee2$(_context2) {
74302
74405
  while (1) {
74303
- switch (_context.prev = _context.next) {
74406
+ switch (_context2.prev = _context2.next) {
74304
74407
  case 0:
74305
74408
  /**
74306
74409
  * 初始化study
@@ -74411,7 +74514,7 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74411
74514
  });
74412
74515
 
74413
74516
  if (!needCheckMultiFrame) {
74414
- _context.next = 47;
74517
+ _context2.next = 47;
74415
74518
  break;
74416
74519
  }
74417
74520
 
@@ -74419,25 +74522,25 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74419
74522
 
74420
74523
  case 31:
74421
74524
  if (!(i < series.length)) {
74422
- _context.next = 47;
74525
+ _context2.next = 47;
74423
74526
  break;
74424
74527
  }
74425
74528
 
74426
74529
  item = series[i];
74427
74530
 
74428
74531
  if (!(item.numberOfSeriesRelatedInstances && item.numberOfSeriesRelatedInstances === 1)) {
74429
- _context.next = 44;
74532
+ _context2.next = 44;
74430
74533
  break;
74431
74534
  }
74432
74535
 
74433
74536
  wado = lodash$1.cloneDeep(item.imageIds[0].split(':'));
74434
74537
  wado.shift();
74435
74538
  url = wado.join(':');
74436
- _context.next = 39;
74539
+ _context2.next = 39;
74437
74540
  return cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.load(url, cornerstoneWADOImageLoader.internal.xhrRequest);
74438
74541
 
74439
74542
  case 39:
74440
- dataSet = _context.sent;
74543
+ dataSet = _context2.sent;
74441
74544
  // 这边如果加载了的话 进度条也需要匹配上
74442
74545
  propsFromDispatch.setSeriesLoaded(item.seriesInstanceUID);
74443
74546
  numFrames = dataSet.intString('x00280008');
@@ -74462,7 +74565,7 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74462
74565
 
74463
74566
  case 44:
74464
74567
  i++;
74465
- _context.next = 31;
74568
+ _context2.next = 31;
74466
74569
  break;
74467
74570
 
74468
74571
  case 47:
@@ -74521,11 +74624,11 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74521
74624
  })]
74522
74625
  }); // 如果有frameTime的话设置fps
74523
74626
 
74524
- _context.next = 62;
74627
+ _context2.next = 62;
74525
74628
  return loadAndCacheDicom(series[0].imageIds[0]);
74526
74629
 
74527
74630
  case 62:
74528
- dicom = _context.sent;
74631
+ dicom = _context2.sent;
74529
74632
 
74530
74633
  if (dicom && dicom.FrameTime && dicom.FrameTime.value) {
74531
74634
  frameTime = dicom.FrameTime.value;
@@ -74598,10 +74701,10 @@ var mergeProps$C = function mergeProps(propsFromState, propsFromDispatch, ownPro
74598
74701
 
74599
74702
  case 78:
74600
74703
  case "end":
74601
- return _context.stop();
74704
+ return _context2.stop();
74602
74705
  }
74603
74706
  }
74604
- }, _callee);
74707
+ }, _callee2);
74605
74708
  }));
74606
74709
 
74607
74710
  function initSeries(_x, _x2) {