@cornerstonejs/core 1.4.1 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "",
5
5
  "main": "dist/umd/index.js",
6
6
  "types": "dist/esm/index.d.ts",
@@ -44,5 +44,5 @@
44
44
  "type": "individual",
45
45
  "url": "https://ohif.org/donate"
46
46
  },
47
- "gitHead": "13e9e13e8445e84ac0ef70e4214c0c74b324cce3"
47
+ "gitHead": "0cdf896cae00bd44f1930b4aadc666317cd36c66"
48
48
  }
@@ -1,6 +1,7 @@
1
1
  import vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume';
2
2
  import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
3
3
  import vtkColorMaps from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
4
+ import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
4
5
 
5
6
  import cache from '../cache';
6
7
  import {
@@ -50,7 +51,6 @@ import volumeNewImageEventDispatcher, {
50
51
  import Viewport from './Viewport';
51
52
  import type { vtkSlabCamera as vtkSlabCameraType } from './vtkClasses/vtkSlabCamera';
52
53
  import vtkSlabCamera from './vtkClasses/vtkSlabCamera';
53
- import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
54
54
 
55
55
  /**
56
56
  * Abstract base class for volume viewports. VolumeViewports are used to render
@@ -57,6 +57,15 @@ async function createVolumeActor(
57
57
  const volumeActor = vtkVolume.newInstance();
58
58
  volumeActor.setMapper(volumeMapper);
59
59
 
60
+ const numberOfComponents = imageData
61
+ .getPointData()
62
+ .getScalars()
63
+ .getNumberOfComponents();
64
+
65
+ if (numberOfComponents === 3) {
66
+ volumeActor.getProperty().setIndependentComponents(false);
67
+ }
68
+
60
69
  // If the volume is composed of imageIds, we can apply a default VOI based
61
70
  // on either the metadata or the min/max of the middle slice. Example of other
62
71
  // types of volumes which might not be composed of imageIds would be e.g., nrrd, nifti
@@ -93,7 +93,7 @@ function createInternalVTKRepresentation(
93
93
  imageData.setDirection(direction);
94
94
  imageData.setOrigin(origin);
95
95
 
96
- // Add scalar datas to 3D or 4D volume
96
+ // Add scalar data to 3D or 4D volume
97
97
  if (volume.isDynamicVolume()) {
98
98
  const scalarDataArrays = (<Types.IDynamicImageVolume>(
99
99
  volume