Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade vtk.js version to 20.1.0 #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"peerDependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"vtk.js": "^11.14.0",
"vtk.js": "20.1.0",
"cornerstone-core": "^2.5.0",
"cornerstone-tools": "^6.0.0"
},
Expand All @@ -50,7 +50,7 @@
"cornerstone-core": "^2.5.0",
"cornerstone-math": "^0.1.9",
"cornerstone-tools": "^6.0.0",
"cornerstone-wado-image-loader": "^4.0.0",
"cornerstone-wado-image-loader": "^4.0.4",
"cross-env": "^5.2.0",
"css-loader": "^3.0.0",
"dicom-parser": "^1.8.8",
Expand All @@ -75,7 +75,7 @@
"prettier": "^1.18.2",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-cornerstone-viewport": "^4.1.1",
"react-cornerstone-viewport": "^4.1.2",
"react-dom": "^16.8.6",
"react-resize-detector": "^4.2.0",
"react-router-dom": "^5.0.1",
Expand All @@ -84,7 +84,7 @@
"style-loader": "^0.23.1",
"stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0",
"vtk.js": "^11.14.0",
"vtk.js": "^20.1.2",
"webpack": "4.34.0",
"webpack-cli": "^3.3.4",
"webpack-dev-server": "^3.8.0",
Expand Down
16 changes: 10 additions & 6 deletions src/VTKViewport/View2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import cornerstoneTools from 'cornerstone-tools';
import vtkGenericRenderWindow from 'vtk.js/Sources/Rendering/Misc/GenericRenderWindow';
import vtkRenderer from 'vtk.js/Sources/Rendering/Core/Renderer';
import 'vtk.js/Sources/Rendering/Profiles/Volume';
import vtkWidgetManager from 'vtk.js/Sources/Widgets/Core/WidgetManager';
import vtkInteractorStyleMPRSlice from './vtkInteractorStyleMPRSlice';
import vtkPaintFilter from 'vtk.js/Sources/Filters/General/PaintFilter';
Expand Down Expand Up @@ -77,13 +78,15 @@ export default class View2D extends Component {
}

updatePaintbrush() {
const manip = this.paintWidget.getManipulator();
const handle = this.paintWidget.getWidgetState().getHandle();
const camera = this.paintRenderer.getActiveCamera();
const normal = camera.getDirectionOfProjection();
manip.setNormal(...normal);
manip.setOrigin(...camera.getFocalPoint());
handle.rotateFromDirections(handle.getDirection(), normal);
if (typeof handle.rotateFromDirections === 'function') {
const manip = this.paintWidget.getManipulator();
const camera = this.paintRenderer.getActiveCamera();
const normal = camera.getDirectionOfProjection();
manip.setNormal(...normal);
manip.setOrigin(...camera.getFocalPoint());
handle.rotateFromDirections(handle.getDirection(), normal);
}
}

componentDidMount() {
Expand Down Expand Up @@ -193,6 +196,7 @@ export default class View2D extends Component {
const camera = this.renderer.getActiveCamera();

camera.setParallelProjection(true);
camera.orthogonalizeViewUp();
this.renderer.resetCamera();

istyle.setVolumeActor(this.props.volumes[0]);
Expand Down
1 change: 1 addition & 0 deletions src/VTKViewport/View3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import vtkWidgetManager from 'vtk.js/Sources/Widgets/Core/WidgetManager';
import vtkPaintFilter from 'vtk.js/Sources/Filters/General/PaintFilter';
import vtkPaintWidget from 'vtk.js/Sources/Widgets/Widgets3D/PaintWidget';

import 'vtk.js/Sources/Rendering/Profiles/Volume';
import ViewportOverlay from '../ViewportOverlay/ViewportOverlay.js';
import { ViewTypes } from 'vtk.js/Sources/Widgets/Core/WidgetManager/Constants';
import { createSub } from '../lib/createSub.js';
Expand Down
Loading