hellfire 0.30.8 → 0.30.9

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.30.9](http://10.16.100.57/diffusion/115/paladin/compare/v0.30.8...v0.30.9) (2025-08-14)
6
+
7
+
8
+
5
9
  ## [0.30.8](http://10.16.100.57/diffusion/115/paladin/compare/v0.30.7...v0.30.8) (2025-08-09)
6
10
 
7
11
 
package/dist/index.js CHANGED
@@ -10439,19 +10439,42 @@ function executeTask() {
10439
10439
 
10440
10440
  numRequest++;
10441
10441
  task.execute().then(function (res) {
10442
- if (executeCallback) {
10443
- executeCallback(task, taskPool.length);
10444
- }
10442
+ if (!res.sizeInBytes && task.extra.backupId) {
10443
+ // 解析图像数据出问题导致得到的图像是空的
10444
+ // 目前碰到的问题是DR图像压缩后一部分图像会出现解析失败问题,尝试获取原始图像来解决
10445
+ task.backupExecute().then(function (backupRes) {
10446
+ task.putCacheByBackup();
10447
+
10448
+ if (executeCallback) {
10449
+ executeCallback(task, taskPool.length);
10450
+ }
10445
10451
 
10446
- numRequest--;
10447
- task.callbacks && task.callbacks.map(function (callback) {
10448
- callback({
10449
- success: true,
10450
- res: res
10452
+ numRequest--;
10453
+ task.callbacks && task.callbacks.map(function (callback) {
10454
+ callback({
10455
+ success: true,
10456
+ res: backupRes
10457
+ });
10458
+ });
10459
+ delete cachedTask[task.key];
10460
+ executeTask();
10451
10461
  });
10452
- });
10453
- delete cachedTask[task.key];
10454
- executeTask();
10462
+ } else {
10463
+ // 获得正常的图像数据
10464
+ if (executeCallback) {
10465
+ executeCallback(task, taskPool.length);
10466
+ }
10467
+
10468
+ numRequest--;
10469
+ task.callbacks && task.callbacks.map(function (callback) {
10470
+ callback({
10471
+ success: true,
10472
+ res: res
10473
+ });
10474
+ });
10475
+ delete cachedTask[task.key];
10476
+ executeTask();
10477
+ }
10455
10478
  }, function (err) {
10456
10479
  // 请求失败 重试机制
10457
10480
  numRequest--;
@@ -10598,10 +10621,11 @@ function tryToClearPixelData(element, dataSet) {
10598
10621
  function addTaskPool(series) {
10599
10622
  lodash$1.forEach(series, function (item) {
10600
10623
  if (item && item.imageIds) {
10601
- lodash$1.forEach(item.imageIds, function (imageId) {
10624
+ lodash$1.forEach(item.imageIds, function (imageId, index) {
10602
10625
  var imageTask = buildImageRequestTask(imageId, {
10603
10626
  extra: {
10604
- series: item.seriesInstanceUID
10627
+ series: item.seriesInstanceUID,
10628
+ backupId: item.imageIdsBackup && item.imageIdsBackup[index]
10605
10629
  }
10606
10630
  });
10607
10631
  addLoadImageTask(imageTask);
@@ -10645,6 +10669,31 @@ function changePriorityBySeries(seriesInstanceUID, series) {
10645
10669
  }
10646
10670
  }
10647
10671
 
10672
+ function handleTopPriorityTask(imageId, priority, resolve, reject) {
10673
+ var _priority = highLevelPriority;
10674
+
10675
+ if (priority || priority === 0) {
10676
+ _priority = priority;
10677
+ } else {
10678
+ highLevelPriority++;
10679
+ } // imageId提取series uid
10680
+
10681
+
10682
+ var match = imageId.match(/series\/(.*?)\/instances/);
10683
+ var seriesUId = match ? match[1] : null;
10684
+ var imageTask = buildImageRequestTask(imageId, {
10685
+ priority: _priority,
10686
+ extra: {
10687
+ series: seriesUId
10688
+ }
10689
+ });
10690
+ addLoadImageTask(imageTask).then(function (res) {
10691
+ resolve(res);
10692
+ }).catch(function (e) {
10693
+ reject(e);
10694
+ });
10695
+ }
10696
+
10648
10697
  function loadAndCacheImagePlus(imageId, priority, forceRefresh) {
10649
10698
  return new Promise(function (resolve, reject) {
10650
10699
  if (forceRefresh) {
@@ -10655,33 +10704,16 @@ function loadAndCacheImagePlus(imageId, priority, forceRefresh) {
10655
10704
 
10656
10705
  if (imageLoadObject && !forceRefresh) {
10657
10706
  imageLoadObject.promise.then(function (image) {
10658
- resolve(image);
10707
+ if (!image.sizeInBytes) {
10708
+ handleTopPriorityTask(imageId, priority, resolve, reject);
10709
+ } else {
10710
+ resolve(image);
10711
+ }
10659
10712
  }, function (err) {
10660
10713
  reject(err);
10661
10714
  });
10662
10715
  } else {
10663
- var _priority = highLevelPriority;
10664
-
10665
- if (priority || priority === 0) {
10666
- _priority = priority;
10667
- } else {
10668
- highLevelPriority++;
10669
- } // imageId提取series uid
10670
-
10671
-
10672
- var match = imageId.match(/series\/(.*?)\/instances/);
10673
- var seriesUId = match ? match[1] : null;
10674
- var imageTask = buildImageRequestTask(imageId, {
10675
- priority: _priority,
10676
- extra: {
10677
- series: seriesUId
10678
- }
10679
- });
10680
- addLoadImageTask(imageTask).then(function (res) {
10681
- resolve(res);
10682
- }).catch(function (e) {
10683
- reject(e);
10684
- });
10716
+ handleTopPriorityTask(imageId, priority, resolve, reject);
10685
10717
  }
10686
10718
  });
10687
10719
  }
@@ -10693,6 +10725,14 @@ function buildImageRequestTask(imageId) {
10693
10725
  }, config), {}, {
10694
10726
  execute: function execute() {
10695
10727
  return cornerstone.loadAndCacheImage(imageId);
10728
+ },
10729
+ backupExecute: function backupExecute() {
10730
+ cornerstone.imageCache.removeImageLoadObject(imageId);
10731
+ return cornerstone.loadAndCacheImage(config.extra.backupId);
10732
+ },
10733
+ putCacheByBackup: function putCacheByBackup() {
10734
+ var data = cornerstone.imageCache.getImageLoadObject(config.extra.backupId);
10735
+ cornerstone.imageCache.putImageLoadObject(imageId, data);
10696
10736
  }
10697
10737
  });
10698
10738
  }