@cornerstonejs/core
Version:
Cornerstone3D Core
43 lines (42 loc) • 1.61 kB
JavaScript
import { canvasToWorldContextPool, worldToCanvasContextPool, } from '../../helpers/vtkCanvasCoordinateTransforms.js';
import ResolvedViewportView from '../ResolvedViewportView.js';
class Volume3DResolvedView extends ResolvedViewportView {
canvasToWorld(canvasPos) {
return canvasToWorldContextPool({
canvas: this.state.canvas,
canvasPos,
renderer: this.state.renderer,
});
}
worldToCanvas(worldPos) {
return worldToCanvasContextPool({
canvas: this.state.canvas,
renderer: this.state.renderer,
worldPos,
});
}
getFrameOfReferenceUID() {
return this.state.frameOfReferenceUID;
}
buildICamera() {
return {
...this.state.camera,
clippingRange: this.state.camera.clippingRange
? [...this.state.camera.clippingRange]
: this.state.camera.clippingRange,
focalPoint: this.state.camera.focalPoint
? [...this.state.camera.focalPoint]
: this.state.camera.focalPoint,
position: this.state.camera.position
? [...this.state.camera.position]
: this.state.camera.position,
viewPlaneNormal: this.state.camera.viewPlaneNormal
? [...this.state.camera.viewPlaneNormal]
: this.state.camera.viewPlaneNormal,
viewUp: this.state.camera.viewUp
? [...this.state.camera.viewUp]
: this.state.camera.viewUp,
};
}
}
export default Volume3DResolvedView;