@ohif/app 3.7.0-beta.32 → 3.7.0-beta.33

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.
Files changed (29) hide show
  1. package/dist/{270.bundle.a4ff08f18e3da39a030b.js → 270.bundle.49a50e13715da82c083f.js} +97 -103
  2. package/dist/{331.bundle.0293a1135afc1a55d93c.js → 331.bundle.6d141ff13ae957b1db6f.js} +36 -44
  3. package/dist/{707.bundle.f6089591fa5662066ba1.js → 625.bundle.e80ea79cda37ee4b6263.js} +11 -27
  4. package/dist/{728.bundle.75a919489af5ae4c237b.js → 728.bundle.38ad0fbfcf6cfd8f9e9e.js} +4 -3
  5. package/dist/{82.bundle.1e2462a400e956390087.js → 82.bundle.3328dd25b6fd1c1c43f6.js} +2 -2
  6. package/dist/{app.bundle.1dbcce1bc2fd56fa4867.js → app.bundle.543496e18d21f3595028.js} +19 -11
  7. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  8. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  9. package/dist/index.html +1 -1
  10. package/dist/{index.worker.1c69152d710fa7b84bce.worker.js → index.worker.17eee78bdafa44cbb47d.worker.js} +2 -2
  11. package/dist/index.worker.17eee78bdafa44cbb47d.worker.js.map +1 -0
  12. package/dist/sw.js +1 -1
  13. package/package.json +19 -19
  14. package/dist/index.worker.1c69152d710fa7b84bce.worker.js.map +0 -1
  15. /package/dist/{192.bundle.26533b7ad9113e6bc34d.js → 192.bundle.6290fb2377d6a0ea268d.js} +0 -0
  16. /package/dist/{199.bundle.56551652377b05f85f03.js → 199.bundle.4fb8686e11821dae0c90.js} +0 -0
  17. /package/dist/{208.bundle.e1f8d78968791e539ec8.js → 208.bundle.fe1e91f0acf3742925f9.js} +0 -0
  18. /package/dist/{283.bundle.49a1b99c4c644c056e33.js → 283.bundle.f82d3dc59066b118cf27.js} +0 -0
  19. /package/dist/{404.bundle.312d888f29f0fa5a57d9.js → 404.bundle.7b7f4990f9762c2c24ed.js} +0 -0
  20. /package/dist/{50.bundle.446a70d541ad5eaa1152.js → 50.bundle.c11736e7c4a5b65f67e6.js} +0 -0
  21. /package/dist/{616.bundle.4def329c5e77446ce41a.js → 616.bundle.a18d837e98dc2fad072c.js} +0 -0
  22. /package/dist/{707.css → 625.css} +0 -0
  23. /package/dist/{642.bundle.b926cd6e393ac5fa9461.js → 642.bundle.23c1d28e6689362f106f.js} +0 -0
  24. /package/dist/{744.bundle.df7868749b17d157eff3.js → 744.bundle.fd4eae46f382b3e1d496.js} +0 -0
  25. /package/dist/{790.bundle.14d186106edad0c5d0a7.js → 790.bundle.ebfacd71c3af955a92b3.js} +0 -0
  26. /package/dist/{917.bundle.86db126079298a492409.js → 917.bundle.cb498f4f4d85e0248a14.js} +0 -0
  27. /package/dist/{973.bundle.8b40615552054ca421a4.js → 973.bundle.62c5bba110e379cef75e.js} +0 -0
  28. /package/dist/{976.bundle.c6bd57d5f629041c207b.js → 976.bundle.b61d2e7e5ed3bc534c2c.js} +0 -0
  29. /package/dist/{984.bundle.4208516a1e4ea7e1d2aa.js → 984.bundle.5e08be248b0bced4e89b.js} +0 -0
@@ -11672,19 +11672,28 @@ LengthTool.toolName = 'Length';
11672
11672
  /* harmony default export */ const annotation_LengthTool = (LengthTool);
11673
11673
  //# sourceMappingURL=LengthTool.js.map
11674
11674
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/getModalityUnit.js
11675
- function getModalityUnit(modality, isPreScaled, isSuvScaled) {
11675
+
11676
+ function getModalityUnit(modality, imageId, options) {
11676
11677
  if (modality === 'CT') {
11677
11678
  return 'HU';
11678
11679
  }
11679
- else if (modality === 'PT' &&
11680
- isPreScaled === true &&
11681
- isSuvScaled === true) {
11682
- return 'SUV';
11680
+ else if (modality === 'PT') {
11681
+ return _handlePTModality(imageId, options);
11683
11682
  }
11684
11683
  else {
11685
11684
  return '';
11686
11685
  }
11687
11686
  }
11687
+ function _handlePTModality(imageId, options) {
11688
+ if (!options.isPreScaled) {
11689
+ return 'raw';
11690
+ }
11691
+ if (options.isSuvScaled) {
11692
+ return 'SUV';
11693
+ }
11694
+ const petSeriesModule = esm.metaData.get('petSeriesModule', imageId);
11695
+ return petSeriesModule?.units || 'unitless';
11696
+ }
11688
11697
 
11689
11698
  //# sourceMappingURL=getModalityUnit.js.map
11690
11699
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/isViewportPreScaled.js
@@ -11877,16 +11886,20 @@ class ProbeTool extends base_AnnotationTool {
11877
11886
  const canvasCoordinates = viewport.worldToCanvas(point);
11878
11887
  styleSpecifier.annotationUID = annotationUID;
11879
11888
  const color = this.getStyle('color', styleSpecifier, annotation);
11889
+ const modalityUnitOptions = {
11890
+ isPreScaled: isViewportPreScaled(viewport, targetId),
11891
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
11892
+ };
11880
11893
  if (!data.cachedStats[targetId]) {
11881
11894
  data.cachedStats[targetId] = {
11882
11895
  Modality: null,
11883
11896
  index: null,
11884
11897
  value: null,
11885
11898
  };
11886
- this._calculateCachedStats(annotation, renderingEngine, enabledElement);
11899
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement, modalityUnitOptions);
11887
11900
  }
11888
11901
  else if (annotation.invalidated) {
11889
- this._calculateCachedStats(annotation, renderingEngine, enabledElement);
11902
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement, modalityUnitOptions);
11890
11903
  if (viewport instanceof esm.VolumeViewport) {
11891
11904
  const { referencedImageId } = annotation.metadata;
11892
11905
  for (const targetId in data.cachedStats) {
@@ -11912,9 +11925,7 @@ class ProbeTool extends base_AnnotationTool {
11912
11925
  const handleGroupUID = '0';
11913
11926
  drawingSvg_drawHandles(svgDrawingHelper, annotationUID, handleGroupUID, [canvasCoordinates], { color });
11914
11927
  renderStatus = true;
11915
- const isPreScaled = isViewportPreScaled(viewport, targetId);
11916
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
11917
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
11928
+ const textLines = this._getTextLines(data, targetId);
11918
11929
  if (textLines) {
11919
11930
  const textCanvasCoordinates = [
11920
11931
  canvasCoordinates[0] + 6,
@@ -11958,50 +11969,18 @@ class ProbeTool extends base_AnnotationTool {
11958
11969
  utilities_triggerAnnotationRenderForViewportIds(renderingEngine, viewportIdsToRender);
11959
11970
  evt.preventDefault();
11960
11971
  }
11961
- _getTextLines(data, targetId, isPreScaled, isSuvScaled) {
11972
+ _getTextLines(data, targetId) {
11962
11973
  const cachedVolumeStats = data.cachedStats[targetId];
11963
- const { index, Modality, value, SUVBw, SUVLbm, SUVBsa } = cachedVolumeStats;
11964
- if (value === undefined && SUVBw === undefined) {
11974
+ const { index, value, modalityUnit } = cachedVolumeStats;
11975
+ if (value === undefined) {
11965
11976
  return;
11966
11977
  }
11967
11978
  const textLines = [];
11968
- const unit = getModalityUnit(Modality, isPreScaled, isSuvScaled);
11969
11979
  textLines.push(`(${index[0]}, ${index[1]}, ${index[2]})`);
11970
- if (Modality === 'PT' && isPreScaled === true && SUVBw !== undefined) {
11971
- textLines.push(`${SUVBw.toFixed(2)} SUV bw`);
11972
- if (SUVLbm) {
11973
- textLines.push(`${SUVLbm.toFixed(2)} SUV lbm`);
11974
- }
11975
- if (SUVBsa) {
11976
- textLines.push(`${SUVBsa.toFixed(2)} SUV bsa`);
11977
- }
11978
- }
11979
- else {
11980
- textLines.push(`${value.toFixed(2)} ${unit}`);
11981
- }
11980
+ textLines.push(`${value.toFixed(2)} ${modalityUnit}`);
11982
11981
  return textLines;
11983
11982
  }
11984
- _getValueForModality(value, imageVolume, modality) {
11985
- const values = {};
11986
- values['value'] = value;
11987
- if (modality === 'PT' &&
11988
- imageVolume.scaling?.PT &&
11989
- (imageVolume.scaling.PT.suvbwToSuvbsa ||
11990
- imageVolume.scaling.PT.suvbwToSuvlbm)) {
11991
- const { suvbwToSuvlbm, suvbwToSuvbsa } = imageVolume.scaling.PT;
11992
- values['SUVBw'] = value;
11993
- if (suvbwToSuvlbm) {
11994
- const SUVLbm = value * suvbwToSuvlbm;
11995
- values['SUVLbm'] = SUVLbm;
11996
- }
11997
- if (suvbwToSuvbsa) {
11998
- const SUVBsa = value * suvbwToSuvbsa;
11999
- values['SUVBsa'] = SUVBsa;
12000
- }
12001
- }
12002
- return values;
12003
- }
12004
- _calculateCachedStats(annotation, renderingEngine, enabledElement) {
11983
+ _calculateCachedStats(annotation, renderingEngine, enabledElement, modalityUnitOptions) {
12005
11984
  const data = annotation.data;
12006
11985
  const { viewportId, renderingEngineId } = enabledElement;
12007
11986
  const worldPos = data.handles.points[0];
@@ -12032,11 +12011,12 @@ class ProbeTool extends base_AnnotationTool {
12032
12011
  const viewport = viewports[0];
12033
12012
  index[2] = viewport.getCurrentImageIdIndex();
12034
12013
  }
12035
- const values = this._getValueForModality(value, image, modality);
12014
+ const modalityUnit = getModalityUnit(modality, annotation.metadata.referencedImageId, modalityUnitOptions);
12036
12015
  cachedStats[targetId] = {
12037
12016
  index,
12038
- ...values,
12017
+ value,
12039
12018
  Modality: modality,
12019
+ modalityUnit,
12040
12020
  };
12041
12021
  }
12042
12022
  else {
@@ -12144,16 +12124,20 @@ class DragProbeTool extends annotation_ProbeTool {
12144
12124
  const canvasCoordinates = viewport.worldToCanvas(point);
12145
12125
  styleSpecifier.annotationUID = annotationUID;
12146
12126
  const color = this.getStyle('color', styleSpecifier, annotation);
12127
+ const modalityUnitOptions = {
12128
+ isPreScaled: isViewportPreScaled(viewport, targetId),
12129
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
12130
+ };
12147
12131
  if (!data.cachedStats[targetId]) {
12148
12132
  data.cachedStats[targetId] = {
12149
12133
  Modality: null,
12150
12134
  index: null,
12151
12135
  value: null,
12152
12136
  };
12153
- this._calculateCachedStats(annotation, renderingEngine, enabledElement);
12137
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement, modalityUnitOptions);
12154
12138
  }
12155
12139
  else if (annotation.invalidated) {
12156
- this._calculateCachedStats(annotation, renderingEngine, enabledElement);
12140
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement, modalityUnitOptions);
12157
12141
  }
12158
12142
  if (!viewport.getRenderingEngine()) {
12159
12143
  console.warn('Rendering Engine has been destroyed');
@@ -12162,9 +12146,7 @@ class DragProbeTool extends annotation_ProbeTool {
12162
12146
  const handleGroupUID = '0';
12163
12147
  drawingSvg_drawHandles(svgDrawingHelper, annotationUID, handleGroupUID, [canvasCoordinates], { color });
12164
12148
  renderStatus = true;
12165
- const isPreScaled = isViewportPreScaled(viewport, targetId);
12166
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
12167
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
12149
+ const textLines = this._getTextLines(data, targetId);
12168
12150
  if (textLines) {
12169
12151
  const textCanvasCoordinates = [
12170
12152
  canvasCoordinates[0] + 6,
@@ -12579,6 +12561,10 @@ class RectangleROITool extends base_AnnotationTool {
12579
12561
  const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
12580
12562
  const color = this.getStyle('color', styleSpecifier, annotation);
12581
12563
  const { viewPlaneNormal, viewUp } = viewport.getCamera();
12564
+ const modalityUnitOptions = {
12565
+ isPreScaled: isViewportPreScaled(viewport, targetId),
12566
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
12567
+ };
12582
12568
  if (!data.cachedStats[targetId] ||
12583
12569
  data.cachedStats[targetId].areaUnit === undefined) {
12584
12570
  data.cachedStats[targetId] = {
@@ -12589,10 +12575,10 @@ class RectangleROITool extends base_AnnotationTool {
12589
12575
  stdDev: null,
12590
12576
  areaUnit: null,
12591
12577
  };
12592
- this._calculateCachedStats(annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement);
12578
+ this._calculateCachedStats(annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement, modalityUnitOptions);
12593
12579
  }
12594
12580
  else if (annotation.invalidated) {
12595
- this._throttledCalculateCachedStats(annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement);
12581
+ this._throttledCalculateCachedStats(annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement, modalityUnitOptions);
12596
12582
  if (viewport instanceof esm.VolumeViewport) {
12597
12583
  const { referencedImageId } = annotation.metadata;
12598
12584
  for (const targetId in data.cachedStats) {
@@ -12638,9 +12624,7 @@ class RectangleROITool extends base_AnnotationTool {
12638
12624
  lineWidth,
12639
12625
  }, dataId);
12640
12626
  renderStatus = true;
12641
- const isPreScaled = isViewportPreScaled(viewport, targetId);
12642
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
12643
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
12627
+ const textLines = this._getTextLines(data, targetId);
12644
12628
  if (!textLines || textLines.length === 0) {
12645
12629
  continue;
12646
12630
  }
@@ -12671,21 +12655,20 @@ class RectangleROITool extends base_AnnotationTool {
12671
12655
  height: Math.abs(point0[1] - point1[1]),
12672
12656
  };
12673
12657
  };
12674
- this._getTextLines = (data, targetId, isPreScaled, isSuvScaled) => {
12658
+ this._getTextLines = (data, targetId) => {
12675
12659
  const cachedVolumeStats = data.cachedStats[targetId];
12676
- const { area, mean, max, stdDev, Modality, areaUnit } = cachedVolumeStats;
12660
+ const { area, mean, max, stdDev, areaUnit, modalityUnit } = cachedVolumeStats;
12677
12661
  if (mean === undefined) {
12678
12662
  return;
12679
12663
  }
12680
12664
  const textLines = [];
12681
- const unit = getModalityUnit(Modality, isPreScaled, isSuvScaled);
12682
12665
  textLines.push(`Area: ${area.toFixed(2)} ${areaUnit}\xb2`);
12683
- textLines.push(`Mean: ${mean.toFixed(2)} ${unit}`);
12684
- textLines.push(`Max: ${max.toFixed(2)} ${unit}`);
12685
- textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${unit}`);
12666
+ textLines.push(`Mean: ${mean.toFixed(2)} ${modalityUnit}`);
12667
+ textLines.push(`Max: ${max.toFixed(2)} ${modalityUnit}`);
12668
+ textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${modalityUnit}`);
12686
12669
  return textLines;
12687
12670
  };
12688
- this._calculateCachedStats = (annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement) => {
12671
+ this._calculateCachedStats = (annotation, viewPlaneNormal, viewUp, renderingEngine, enabledElement, modalityUnitOptions) => {
12689
12672
  const { data } = annotation;
12690
12673
  const { viewportId, renderingEngineId } = enabledElement;
12691
12674
  const worldPos1 = data.handles.points[0];
@@ -12748,6 +12731,7 @@ class RectangleROITool extends base_AnnotationTool {
12748
12731
  }
12749
12732
  stdDev /= count;
12750
12733
  stdDev = Math.sqrt(stdDev);
12734
+ const modalityUnit = getModalityUnit(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
12751
12735
  cachedStats[targetId] = {
12752
12736
  Modality: metadata.Modality,
12753
12737
  area,
@@ -12755,6 +12739,7 @@ class RectangleROITool extends base_AnnotationTool {
12755
12739
  stdDev,
12756
12740
  max,
12757
12741
  areaUnit: hasPixelSpacing ? 'mm' : 'px',
12742
+ modalityUnit,
12758
12743
  };
12759
12744
  }
12760
12745
  else {
@@ -13245,6 +13230,10 @@ class EllipticalROITool extends base_AnnotationTool {
13245
13230
  canvasCorners = (getCanvasEllipseCorners(canvasCoordinates));
13246
13231
  }
13247
13232
  const { centerPointRadius } = this.configuration;
13233
+ const modalityUnitOptions = {
13234
+ isPreScaled: isViewportPreScaled(viewport, targetId),
13235
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
13236
+ };
13248
13237
  if (!data.cachedStats[targetId] ||
13249
13238
  data.cachedStats[targetId].areaUnit === undefined) {
13250
13239
  data.cachedStats[targetId] = {
@@ -13255,10 +13244,10 @@ class EllipticalROITool extends base_AnnotationTool {
13255
13244
  stdDev: null,
13256
13245
  areaUnit: null,
13257
13246
  };
13258
- this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
13247
+ this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
13259
13248
  }
13260
13249
  else if (annotation.invalidated) {
13261
- this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
13250
+ this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
13262
13251
  if (viewport instanceof esm.VolumeViewport) {
13263
13252
  const { referencedImageId } = annotation.metadata;
13264
13253
  for (const targetId in data.cachedStats) {
@@ -13315,9 +13304,7 @@ class EllipticalROITool extends base_AnnotationTool {
13315
13304
  }
13316
13305
  }
13317
13306
  renderStatus = true;
13318
- const isPreScaled = isViewportPreScaled(viewport, targetId);
13319
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
13320
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
13307
+ const textLines = this._getTextLines(data, targetId);
13321
13308
  if (!textLines || textLines.length === 0) {
13322
13309
  continue;
13323
13310
  }
@@ -13340,11 +13327,10 @@ class EllipticalROITool extends base_AnnotationTool {
13340
13327
  }
13341
13328
  return renderStatus;
13342
13329
  };
13343
- this._getTextLines = (data, targetId, isPreScaled, isSuvScaled) => {
13330
+ this._getTextLines = (data, targetId) => {
13344
13331
  const cachedVolumeStats = data.cachedStats[targetId];
13345
- const { area, mean, stdDev, max, isEmptyArea, Modality, areaUnit } = cachedVolumeStats;
13332
+ const { area, mean, stdDev, max, isEmptyArea, areaUnit, modalityUnit } = cachedVolumeStats;
13346
13333
  const textLines = [];
13347
- const unit = getModalityUnit(Modality, isPreScaled, isSuvScaled);
13348
13334
  if (area) {
13349
13335
  const areaLine = isEmptyArea
13350
13336
  ? `Area: Oblique not supported`
@@ -13352,17 +13338,17 @@ class EllipticalROITool extends base_AnnotationTool {
13352
13338
  textLines.push(areaLine);
13353
13339
  }
13354
13340
  if (mean) {
13355
- textLines.push(`Mean: ${mean.toFixed(2)} ${unit}`);
13341
+ textLines.push(`Mean: ${mean.toFixed(2)} ${modalityUnit}`);
13356
13342
  }
13357
13343
  if (max) {
13358
- textLines.push(`Max: ${max.toFixed(2)} ${unit}`);
13344
+ textLines.push(`Max: ${max.toFixed(2)} ${modalityUnit}`);
13359
13345
  }
13360
13346
  if (stdDev) {
13361
- textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${unit}`);
13347
+ textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${modalityUnit}`);
13362
13348
  }
13363
13349
  return textLines;
13364
13350
  };
13365
- this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement) => {
13351
+ this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions) => {
13366
13352
  const data = annotation.data;
13367
13353
  const { viewportId, renderingEngineId } = enabledElement;
13368
13354
  const { points } = data.handles;
@@ -13436,6 +13422,7 @@ class EllipticalROITool extends base_AnnotationTool {
13436
13422
  pointInShapeCallback(imageData, (pointLPS, pointIJK) => pointInEllipse(ellipseObj, pointLPS), stdCalculator, boundsIJK);
13437
13423
  stdDev /= count;
13438
13424
  stdDev = Math.sqrt(stdDev);
13425
+ const modalityUnit = getModalityUnit(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
13439
13426
  cachedStats[targetId] = {
13440
13427
  Modality: metadata.Modality,
13441
13428
  area,
@@ -13444,6 +13431,7 @@ class EllipticalROITool extends base_AnnotationTool {
13444
13431
  stdDev,
13445
13432
  isEmptyArea,
13446
13433
  areaUnit: hasPixelSpacing ? 'mm' : 'px',
13434
+ modalityUnit,
13447
13435
  };
13448
13436
  }
13449
13437
  else {
@@ -13883,6 +13871,10 @@ class CircleROITool extends base_AnnotationTool {
13883
13871
  const radius = getCanvasCircleRadius(canvasCoordinates);
13884
13872
  const canvasCorners = getCanvasCircleCorners(canvasCoordinates);
13885
13873
  const { centerPointRadius } = this.configuration;
13874
+ const modalityUnitOptions = {
13875
+ isPreScaled: isViewportPreScaled(viewport, targetId),
13876
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
13877
+ };
13886
13878
  if (!data.cachedStats[targetId] ||
13887
13879
  data.cachedStats[targetId].areaUnit === undefined) {
13888
13880
  data.cachedStats[targetId] = {
@@ -13896,10 +13888,10 @@ class CircleROITool extends base_AnnotationTool {
13896
13888
  radiusUnit: null,
13897
13889
  perimeter: null,
13898
13890
  };
13899
- this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
13891
+ this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
13900
13892
  }
13901
13893
  else if (annotation.invalidated) {
13902
- this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
13894
+ this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
13903
13895
  if (viewport instanceof esm.VolumeViewport) {
13904
13896
  const { referencedImageId } = annotation.metadata;
13905
13897
  for (const targetId in data.cachedStats) {
@@ -13954,9 +13946,7 @@ class CircleROITool extends base_AnnotationTool {
13954
13946
  }
13955
13947
  }
13956
13948
  renderStatus = true;
13957
- const isPreScaled = isViewportPreScaled(viewport, targetId);
13958
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
13959
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
13949
+ const textLines = this._getTextLines(data, targetId);
13960
13950
  if (!textLines || textLines.length === 0) {
13961
13951
  continue;
13962
13952
  }
@@ -13979,11 +13969,10 @@ class CircleROITool extends base_AnnotationTool {
13979
13969
  }
13980
13970
  return renderStatus;
13981
13971
  };
13982
- this._getTextLines = (data, targetId, isPreScaled, isSuvScaled) => {
13972
+ this._getTextLines = (data, targetId) => {
13983
13973
  const cachedVolumeStats = data.cachedStats[targetId];
13984
- const { radius, radiusUnit, area, mean, stdDev, max, isEmptyArea, Modality, areaUnit, } = cachedVolumeStats;
13974
+ const { radius, radiusUnit, area, mean, stdDev, max, isEmptyArea, Modality, areaUnit, modalityUnit, } = cachedVolumeStats;
13985
13975
  const textLines = [];
13986
- const unit = getModalityUnit(Modality, isPreScaled, isSuvScaled);
13987
13976
  if (radius) {
13988
13977
  const radiusLine = isEmptyArea
13989
13978
  ? `Radius: Oblique not supported`
@@ -13997,17 +13986,17 @@ class CircleROITool extends base_AnnotationTool {
13997
13986
  textLines.push(areaLine);
13998
13987
  }
13999
13988
  if (mean) {
14000
- textLines.push(`Mean: ${mean.toFixed(2)} ${unit}`);
13989
+ textLines.push(`Mean: ${mean.toFixed(2)} ${modalityUnit}`);
14001
13990
  }
14002
13991
  if (max) {
14003
- textLines.push(`Max: ${max.toFixed(2)} ${unit}`);
13992
+ textLines.push(`Max: ${max.toFixed(2)} ${modalityUnit}`);
14004
13993
  }
14005
13994
  if (stdDev) {
14006
- textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${unit}`);
13995
+ textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${modalityUnit}`);
14007
13996
  }
14008
13997
  return textLines;
14009
13998
  };
14010
- this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement) => {
13999
+ this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions) => {
14011
14000
  const data = annotation.data;
14012
14001
  const { viewportId, renderingEngineId } = enabledElement;
14013
14002
  const { points } = data.handles;
@@ -14081,6 +14070,7 @@ class CircleROITool extends base_AnnotationTool {
14081
14070
  pointInShapeCallback(imageData, (pointLPS, pointIJK) => pointInEllipse(ellipseObj, pointLPS), stdCalculator, boundsIJK);
14082
14071
  stdDev /= count;
14083
14072
  stdDev = Math.sqrt(stdDev);
14073
+ const modalityUnit = getModalityUnit(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
14084
14074
  cachedStats[targetId] = {
14085
14075
  Modality: metadata.Modality,
14086
14076
  area,
@@ -14092,6 +14082,7 @@ class CircleROITool extends base_AnnotationTool {
14092
14082
  radius: worldWidth / 2,
14093
14083
  radiusUnit: hasPixelSpacing ? 'mm' : 'px',
14094
14084
  perimeter: 2 * Math.PI * (worldWidth / 2),
14085
+ modalityUnit,
14095
14086
  };
14096
14087
  }
14097
14088
  else {
@@ -16061,6 +16052,10 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16061
16052
  if (annotation.annotationUID === activeAnnotationUID &&
16062
16053
  !this.commonData?.movingTextBox)
16063
16054
  return;
16055
+ const modalityUnitOptions = {
16056
+ isPreScaled: isViewportPreScaled(viewport, targetId),
16057
+ isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
16058
+ };
16064
16059
  if (!this.commonData?.movingTextBox) {
16065
16060
  const { data } = annotation;
16066
16061
  if (!data.cachedStats[targetId] ||
@@ -16073,17 +16068,17 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16073
16068
  stdDev: null,
16074
16069
  areaUnit: null,
16075
16070
  };
16076
- this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
16071
+ this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
16077
16072
  }
16078
16073
  else if (annotation.invalidated) {
16079
- this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
16074
+ this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions);
16080
16075
  }
16081
16076
  }
16082
16077
  this._renderStats(annotation, viewport, enabledElement, svgDrawingHelper);
16083
16078
  });
16084
16079
  return renderStatus;
16085
16080
  };
16086
- this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement) => {
16081
+ this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement, modalityUnitOptions) => {
16087
16082
  const data = annotation.data;
16088
16083
  const { cachedStats, polyline: points } = data;
16089
16084
  const targetIds = Object.keys(cachedStats);
@@ -16178,6 +16173,7 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16178
16173
  const mean = sum / count;
16179
16174
  let stdDev = sumSquares / count - mean ** 2;
16180
16175
  stdDev = Math.sqrt(stdDev);
16176
+ const modalityUnit = getModalityUnit(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
16181
16177
  cachedStats[targetId] = {
16182
16178
  Modality: metadata.Modality,
16183
16179
  area,
@@ -16185,6 +16181,7 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16185
16181
  max,
16186
16182
  stdDev,
16187
16183
  areaUnit: hasPixelSpacing ? 'mm' : 'px',
16184
+ modalityUnit,
16188
16185
  };
16189
16186
  }
16190
16187
  this.triggerAnnotationModified(annotation, enabledElement);
@@ -16194,9 +16191,7 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16194
16191
  this._renderStats = (annotation, viewport, enabledElement, svgDrawingHelper) => {
16195
16192
  const data = annotation.data;
16196
16193
  const targetId = this.getTargetId(viewport);
16197
- const isPreScaled = isViewportPreScaled(viewport, targetId);
16198
- const isSuvScaled = this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId);
16199
- const textLines = this._getTextLines(data, targetId, isPreScaled, isSuvScaled);
16194
+ const textLines = this._getTextLines(data, targetId);
16200
16195
  if (!textLines || textLines.length === 0)
16201
16196
  return;
16202
16197
  const canvasCoordinates = data.polyline.map((p) => viewport.worldToCanvas(p));
@@ -16221,11 +16216,10 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16221
16216
  bottomRight: viewport.canvasToWorld([left + width, top + height]),
16222
16217
  };
16223
16218
  };
16224
- this._getTextLines = (data, targetId, isPreScaled, isSuvScaled) => {
16219
+ this._getTextLines = (data, targetId) => {
16225
16220
  const cachedVolumeStats = data.cachedStats[targetId];
16226
- const { area, mean, stdDev, max, isEmptyArea, Modality, areaUnit } = cachedVolumeStats;
16221
+ const { area, mean, stdDev, max, isEmptyArea, areaUnit, modalityUnit } = cachedVolumeStats;
16227
16222
  const textLines = [];
16228
- const unit = getModalityUnit(Modality, isPreScaled, isSuvScaled);
16229
16223
  if (area) {
16230
16224
  const areaLine = isEmptyArea
16231
16225
  ? `Area: Oblique not supported`
@@ -16233,13 +16227,13 @@ class PlanarFreehandROITool extends base_AnnotationTool {
16233
16227
  textLines.push(areaLine);
16234
16228
  }
16235
16229
  if (mean) {
16236
- textLines.push(`Mean: ${mean.toFixed(2)} ${unit}`);
16230
+ textLines.push(`Mean: ${mean.toFixed(2)} ${modalityUnit}`);
16237
16231
  }
16238
16232
  if (max) {
16239
- textLines.push(`Max: ${max.toFixed(2)} ${unit}`);
16233
+ textLines.push(`Max: ${max.toFixed(2)} ${modalityUnit}`);
16240
16234
  }
16241
16235
  if (stdDev) {
16242
- textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${unit}`);
16236
+ textLines.push(`Std Dev: ${stdDev.toFixed(2)} ${modalityUnit}`);
16243
16237
  }
16244
16238
  return textLines;
16245
16239
  };
@@ -22875,7 +22869,7 @@ function voiSyncCallback(synchronizerInstance, sourceViewport, targetViewport, v
22875
22869
  if (invertStateChanged) {
22876
22870
  tProperties.invert = invert;
22877
22871
  }
22878
- if (tViewport instanceof esm.VolumeViewport) {
22872
+ if (tViewport instanceof esm.BaseVolumeViewport) {
22879
22873
  tViewport.setProperties(tProperties, volumeId);
22880
22874
  }
22881
22875
  else if (tViewport instanceof esm.StackViewport) {
@@ -45518,6 +45518,13 @@ async function createVolumeActor(props, element, viewportId, suppressEvents = fa
45518
45518
  }
45519
45519
  const volumeActor = vtkVolume$1.newInstance();
45520
45520
  volumeActor.setMapper(volumeMapper);
45521
+ const numberOfComponents = imageData
45522
+ .getPointData()
45523
+ .getScalars()
45524
+ .getNumberOfComponents();
45525
+ if (numberOfComponents === 3) {
45526
+ volumeActor.getProperty().setIndependentComponents(false);
45527
+ }
45521
45528
  if (imageVolume.imageIds) {
45522
45529
  await helpers_setDefaultVolumeVOI(volumeActor, imageVolume, use16BitTexture);
45523
45530
  }
@@ -46327,6 +46334,7 @@ class Viewport {
46327
46334
 
46328
46335
 
46329
46336
 
46337
+
46330
46338
  class BaseVolumeViewport extends RenderingEngine_Viewport {
46331
46339
  constructor(props) {
46332
46340
  super(props);
@@ -46408,12 +46416,6 @@ class BaseVolumeViewport extends RenderingEngine_Viewport {
46408
46416
  return volumeImageURIs.includes(imageURI);
46409
46417
  });
46410
46418
  };
46411
- this.getCurrentImageIdIndex = () => {
46412
- throw new Error('Method not implemented.');
46413
- };
46414
- this.getCurrentImageId = () => {
46415
- throw new Error('Method not implemented.');
46416
- };
46417
46419
  this.useCPURendering = getShouldUseCPURendering();
46418
46420
  this.use16BitTexture = this._shouldUseNativeDataType();
46419
46421
  if (this.useCPURendering) {
@@ -46805,20 +46807,30 @@ class BaseVolumeViewport extends RenderingEngine_Viewport {
46805
46807
  throw new Error(`Invalid orientation: ${orientation}. Valid orientations are: ${Object.keys(constants_mprCameraValues).join(', ')}`);
46806
46808
  }
46807
46809
  }
46808
- resetCamera(resetPan, resetZoom, resetToCenter) {
46809
- return super.resetCamera(resetPan, resetZoom, resetToCenter);
46810
+ getSlabThickness() {
46811
+ const actors = this.getActors();
46812
+ let slabThickness = rendering.MINIMUM_SLAB_THICKNESS;
46813
+ actors.forEach((actor) => {
46814
+ if (actor.slabThickness > slabThickness) {
46815
+ slabThickness = actor.slabThickness;
46816
+ }
46817
+ });
46818
+ return slabThickness;
46810
46819
  }
46811
46820
  getIntensityFromWorld(point) {
46812
- throw new Error('Method not implemented.');
46813
- }
46814
- setBlendMode(blendMode, filterActorUIDs, immediate) {
46815
- throw new Error('Method not implemented.');
46816
- }
46817
- setSlabThickness(slabThickness, filterActorUIDs) {
46818
- throw new Error('Method not implemented.');
46819
- }
46820
- getSlabThickness() {
46821
- throw new Error('Method not implemented.');
46821
+ const actorEntry = this.getDefaultActor();
46822
+ if (!actorIsA(actorEntry, 'vtkVolume')) {
46823
+ return;
46824
+ }
46825
+ const { actor, uid } = actorEntry;
46826
+ const imageData = actor.getMapper().getInputData();
46827
+ const volume = esm_cache.getVolume(uid);
46828
+ const { dimensions } = volume;
46829
+ const index = transformWorldToIndex(imageData, point);
46830
+ const voxelIndex = index[2] * dimensions[0] * dimensions[1] +
46831
+ index[1] * dimensions[0] +
46832
+ index[0];
46833
+ return volume.getScalarData()[voxelIndex];
46822
46834
  }
46823
46835
  }
46824
46836
  /* harmony default export */ const RenderingEngine_BaseVolumeViewport = (BaseVolumeViewport);
@@ -46831,7 +46843,6 @@ class BaseVolumeViewport extends RenderingEngine_Viewport {
46831
46843
 
46832
46844
 
46833
46845
 
46834
-
46835
46846
  class VolumeViewport extends RenderingEngine_BaseVolumeViewport {
46836
46847
  constructor(props) {
46837
46848
  super(props);
@@ -46945,21 +46956,6 @@ class VolumeViewport extends RenderingEngine_BaseVolumeViewport {
46945
46956
  });
46946
46957
  this.resetCamera();
46947
46958
  }
46948
- getIntensityFromWorld(point) {
46949
- const actorEntry = this.getDefaultActor();
46950
- if (!actorIsA(actorEntry, 'vtkVolume')) {
46951
- return;
46952
- }
46953
- const { actor, uid } = actorEntry;
46954
- const imageData = actor.getMapper().getInputData();
46955
- const volume = esm_cache.getVolume(uid);
46956
- const { dimensions } = volume;
46957
- const index = transformWorldToIndex(imageData, point);
46958
- const voxelIndex = index[2] * dimensions[0] * dimensions[1] +
46959
- index[1] * dimensions[0] +
46960
- index[0];
46961
- return volume.getScalarData()[voxelIndex];
46962
- }
46963
46959
  setBlendMode(blendMode, filterActorUIDs = [], immediate = false) {
46964
46960
  let actorEntries = this.getActors();
46965
46961
  if (filterActorUIDs && filterActorUIDs.length > 0) {
@@ -47020,16 +47016,6 @@ class VolumeViewport extends RenderingEngine_BaseVolumeViewport {
47020
47016
  this.updateClippingPlanesForActors(currentCamera);
47021
47017
  this.triggerCameraModifiedEventIfNecessary(currentCamera, currentCamera);
47022
47018
  }
47023
- getSlabThickness() {
47024
- const actors = this.getActors();
47025
- let slabThickness = rendering.MINIMUM_SLAB_THICKNESS;
47026
- actors.forEach((actor) => {
47027
- if (actor.slabThickness > slabThickness) {
47028
- slabThickness = actor.slabThickness;
47029
- }
47030
- });
47031
- return slabThickness;
47032
- }
47033
47019
  }
47034
47020
  /* harmony default export */ const RenderingEngine_VolumeViewport = (VolumeViewport);
47035
47021
  //# sourceMappingURL=VolumeViewport.js.map
@@ -49715,6 +49701,12 @@ class VolumeViewport3D extends RenderingEngine_BaseVolumeViewport {
49715
49701
  this.resetVolumeViewportClippingRange();
49716
49702
  return;
49717
49703
  }
49704
+ setSlabThickness(slabThickness, filterActorUIDs) {
49705
+ return null;
49706
+ }
49707
+ setBlendMode(blendMode, filterActorUIDs, immediate) {
49708
+ return null;
49709
+ }
49718
49710
  }
49719
49711
  /* harmony default export */ const RenderingEngine_VolumeViewport3D = (VolumeViewport3D);
49720
49712
  //# sourceMappingURL=VolumeViewport3D.js.map