File tree Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function setupSyncedBrush(imageDataObject) {
31
31
32
32
// If you want to load a segmentation labelmap, you would want to load
33
33
// it into this array at this point.
34
- const threeDimensionalPixelData = new Uint16Array ( numVolumePixels ) ;
34
+ const threeDimensionalPixelData = new Float32Array ( numVolumePixels ) ;
35
35
36
36
const buffer = threeDimensionalPixelData . buffer ;
37
37
const imageIds = imageDataObject . imageIds ;
@@ -41,6 +41,9 @@ function setupSyncedBrush(imageDataObject) {
41
41
throw new Error ( 'Depth should match the number of imageIds' ) ;
42
42
}
43
43
44
+ // Use Float32Arrays in cornerstoneTools for interoperability.
45
+ segmentationModule . configuration . arrayType = 1 ;
46
+
44
47
segmentationModule . setters . labelmap3DByFirstImageId (
45
48
imageIds [ 0 ] ,
46
49
buffer ,
@@ -324,6 +327,7 @@ class VTKCornerstonePaintingSyncExample extends Component {
324
327
/>
325
328
) }
326
329
</ div >
330
+
327
331
< div className = "col-xs-12 col-sm-6" style = { { height : '512px' } } >
328
332
{ this . state . cornerstoneViewportData && (
329
333
< CornerstoneViewport
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ function createLabelMapImageData(backgroundImageData) {
64
64
labelMapData . setDimensions ( backgroundImageData . getDimensions ( ) ) ;
65
65
labelMapData . computeTransforms ( ) ;
66
66
67
- const values = new Uint16Array ( backgroundImageData . getNumberOfPoints ( ) ) ;
67
+ const values = new Float32Array ( backgroundImageData . getNumberOfPoints ( ) ) ;
68
68
const dataArray = vtkDataArray . newInstance ( {
69
69
numberOfComponents : 1 , // labelmap with single component
70
70
values,
@@ -162,7 +162,7 @@ class VTKMPRPaintingExample extends Component {
162
162
clearLabelMap = ( ) => {
163
163
const labelMapImageData = this . state . paintFilterLabelMapImageData ;
164
164
const numberOfPoints = labelMapImageData . getNumberOfPoints ( ) ;
165
- const values = new Uint8Array ( numberOfPoints ) ;
165
+ const values = new Float32Array ( numberOfPoints ) ;
166
166
const dataArray = vtkDataArray . newInstance ( {
167
167
numberOfComponents : 1 , // labelmap with single component
168
168
values,
Original file line number Diff line number Diff line change 47
47
"copy-webpack-plugin" : " ^5.0.4" ,
48
48
"cornerstone-core" : " ^2.3.0" ,
49
49
"cornerstone-math" : " ^0.1.8" ,
50
- "cornerstone-tools" : " ^4.5.2 " ,
50
+ "cornerstone-tools" : " ^4.11.0 " ,
51
51
"cornerstone-wado-image-loader" : " ^3.0.5" ,
52
52
"cross-env" : " ^5.2.0" ,
53
53
"css-loader" : " ^3.0.0" ,
Original file line number Diff line number Diff line change @@ -440,6 +440,7 @@ export default class View2D extends Component {
440
440
this . subs . labelmap . unsubscribe ( ) ;
441
441
442
442
const labelmapImageData = this . props . paintFilterLabelMapImageData ;
443
+
443
444
const labelmap = createLabelPipeline (
444
445
this . props . paintFilterBackgroundImageData ,
445
446
labelmapImageData ,
Original file line number Diff line number Diff line change @@ -3458,10 +3458,10 @@ cornerstone-math@^0.1.8:
3458
3458
resolved "https://registry.yarnpkg.com/cornerstone-math/-/cornerstone-math-0.1.8.tgz#68ab1f9e4fdcd7c5cb23a0d2eb4263f9f894f1c5"
3459
3459
integrity sha512-x7NEQHBtVG7j1yeyj/aRoKTpXv1Vh2/H9zNLMyqYJDtJkNng8C4Q8M3CgZ1qer0Yr7eVq2x+Ynmj6kfOm5jXKw==
3460
3460
3461
- cornerstone-tools@^4.5.2 :
3462
- version "4.8.1 "
3463
- resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-4.8.1 .tgz#a821c503886c384f3321e895ddd4c3350eb7d355 "
3464
- integrity sha512-TPB2imrlHf/miVpnbP+QCjqlf3tKcwXdLpr7A6M6Q6vPEmJUW8p8h5rfZQrJcfmxi2zz0VGxNlVRHBt/lgo0JQ ==
3461
+ cornerstone-tools@^4.11.0 :
3462
+ version "4.11.0 "
3463
+ resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-4.11.0 .tgz#746839ec318510150c8d196a9b6d029138de1cbb "
3464
+ integrity sha512-2HuPcZ9or93OItOrG1QbF8JMWaAWTPpAC/1ahHJdM4SP5kzzOO1GJMuuUFTOmeWfwezq9ZyoQm/KBMXg4yOIWQ ==
3465
3465
dependencies:
3466
3466
"@babel/runtime" "7.1.2"
3467
3467
cornerstone-math "0.1.7"
You can’t perform that action at this time.
0 commit comments