@cornerstonejs/core 2.1.16 → 2.1.18

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.
@@ -84,26 +84,23 @@ class BaseVolumeViewport extends Viewport {
84
84
  return;
85
85
  }
86
86
  const { colormap: latestColormap, VOILUTFunction, interpolationType, invert, slabThickness, preset, } = this.viewportProperties;
87
- const volume = cache.getVolume(this.getVolumeId());
87
+ volumeId ||= this.getVolumeId();
88
+ const volume = cache.getVolume(volumeId);
88
89
  if (!volume) {
89
90
  return null;
90
91
  }
91
- const voiRanges = this.getActors()
92
- .map((actorEntry) => {
93
- const volumeActor = actorEntry.actor;
94
- if (!actorIsA(actorEntry, 'vtkVolume')) {
95
- return null;
96
- }
97
- const cfun = volumeActor.getProperty().getRGBTransferFunction(0);
98
- const [lower, upper] = this.viewportProperties?.VOILUTFunction === 'SIGMOID'
99
- ? getVoiFromSigmoidRGBTransferFunction(cfun)
100
- : cfun.getRange();
101
- return { volumeId, voiRange: { lower, upper } };
102
- })
103
- .filter(Boolean);
104
- const voiRange = volumeId
105
- ? voiRanges.find((range) => range.volumeId === volumeId)?.voiRange
106
- : voiRanges[0]?.voiRange;
92
+ const volumeActorEntry = this.getActors().find((actorEntry) => {
93
+ return actorEntry.referencedId === volumeId;
94
+ });
95
+ if (!volumeActorEntry) {
96
+ return;
97
+ }
98
+ const volumeActor = volumeActorEntry.actor;
99
+ const cfun = volumeActor.getProperty().getRGBTransferFunction(0);
100
+ const [lower, upper] = this.viewportProperties?.VOILUTFunction === 'SIGMOID'
101
+ ? getVoiFromSigmoidRGBTransferFunction(cfun)
102
+ : cfun.getRange();
103
+ const voiRange = { lower, upper };
107
104
  const volumeColormap = this.getColormap(volumeId);
108
105
  const colormap = volumeId && volumeColormap ? volumeColormap : latestColormap;
109
106
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "description": "",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -83,5 +83,5 @@
83
83
  "type": "individual",
84
84
  "url": "https://ohif.org/donate"
85
85
  },
86
- "gitHead": "0508857c248400e14118440883a532cd65d8ba05"
86
+ "gitHead": "e20cf17f217a6bfcc145bab57717d49ff339ee98"
87
87
  }