@ohif/extension-vtk: Update VTK extension (#679)

This commit is contained in:
Erik Ziegler 2019-07-18 07:54:53 +02:00 committed by GitHub
parent 546f6bfe68
commit 08ce30e69c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ohif/extension-vtk",
"version": "0.1.3",
"version": "0.1.4",
"description": "OHIF extension for VTK.js",
"author": "OHIF",
"license": "MIT",
@ -39,8 +39,8 @@
},
"dependencies": {
"@babel/runtime": "^7.4.5",
"react-vtkjs-viewport": "0.0.9",
"vtk.js": "^8.11.0"
"react-vtkjs-viewport": "0.0.10",
"vtk.js": "^8.13.0"
},
"devDependencies": {
"@babel/core": "^7.4.5",

View File

@ -189,6 +189,18 @@ class OHIFVTKViewport extends Component {
volumeActor.setMapper(volumeMapper);
volumeMapper.setInputData(data);
// TODO: Should look into implementing autoAdjustSampleDistance in vtk
const sampleDistance =
1.2 *
Math.sqrt(
data
.getSpacing()
.map((v) => v * v)
.reduce((a, b) => a + b, 0)
);
volumeMapper.setSampleDistance(sampleDistance);
volumeCache[displaySetInstanceUid] = volumeActor;
return volumeActor;