feat(vtk): Enable vtk extension (still very much work-in-progress)

This commit is contained in:
Erik Ziegler 2019-03-01 10:55:52 +01:00
parent 932fcea446
commit ec51cb7a6c
24 changed files with 1697 additions and 253 deletions

View File

@ -22,4 +22,5 @@ yarn-debug.log*
yarn-error.log*
.idea
yalc.lock
yalc.lock
.yalc

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Open Health Imaging Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,31 +0,0 @@
# react-vtkjs-viewport
> VTK.js image viewport component for React
[![NPM](https://img.shields.io/npm/v/react-vtkjs-viewport.svg)](https://www.npmjs.com/package/react-vtkjs-viewport)
## Install
```bash
npm install --save react-vtkjs-viewport
```
## Usage
```jsx
import React, { Component } from 'react'
import CornerstoneViewport from 'react-cornerstone-viewport'
class Example extends Component {
render () {
return (
<CornerstoneViewport />
)
}
}
```
## License
MIT © [OHIF](https://github.com/OHIF)

View File

@ -1,55 +0,0 @@
{
"name": "react-vtkjs-viewport",
"version": "0.0.6-76b678ec",
"description": "VTK.js image viewport component for React",
"author": "OHIF Contributors",
"license": "MIT",
"repository": "OHIF/react-vtkjs-viewport",
"main": "dist/index.js",
"engines": {
"node": ">=8",
"npm": ">=5"
},
"scripts": {
"build": "webpack --progress --colors --mode development",
"build:release": "webpack --progress --colors --mode production",
"start": "webpack --watch --progress --colors --mode development",
"prepare": "npm run build:release",
"predeploy": "cd example && npm install && npm run build:release",
"prepublishOnly": "npm run build:release",
"deploy": "gh-pages -d example/build",
"generateStaticSite": "./generateStaticSite.sh"
},
"peerDependencies": {
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,json,css}": [
"prettier --single-quote --write",
"git add"
]
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"files": [
"dist"
],
"dependencies": {
"cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8",
"vtk.js": "^8.3.11"
}
}

View File

@ -1 +0,0 @@
76b678ec6a9c889ca68231a62fd71346

View File

@ -20,8 +20,6 @@
},
"peerDependencies": {
"cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8",
"cornerstone-tools": "^3.1.0",
"cornerstone-wado-image-loader": "^2.2.3",
"dcmjs": "^0.3.6",
"dicom-parser": "^1.8.3",
@ -54,7 +52,7 @@
"prettier": "^1.15.3",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-viewerbase": "^0.2.10",
"react-viewerbase": "^0.2.11",
"rollup": "^1.1.2",
"rollup-plugin-babel": "^4.2.0",
"rollup-plugin-commonjs": "^9.2.0",
@ -90,6 +88,6 @@
"dependencies": {
"@babel/runtime": "^7.2.0",
"classnames": "^2.2.6",
"react-vtkjs-viewport": "file:.yalc/react-vtkjs-viewport"
"react-vtkjs-viewport": "^0.0.7"
}
}

View File

@ -57,6 +57,12 @@ export default {
commonjs({
include: ['node_modules/**', '.yalc/**'],
namedExports: {
'node_modules/react-vtkjs-viewport/dist/index.js': [
'getImageData',
'loadImageData',
'VTKViewport',
'VTKMPRViewport',
],
'.yalc/react-vtkjs-viewport/dist/index.js': [
'getImageData',
'loadImageData',

View File

@ -3,6 +3,7 @@ import { ToolbarSection } from 'react-viewerbase';
import OHIF from 'ohif-core'
const { setToolActive } = OHIF.redux.actions;
const Icons = 'icons.svg';
const mapStateToProps = state => {
const activeButton = state.tools.buttons.find(tool => tool.active === true);
@ -12,8 +13,7 @@ const mapStateToProps = state => {
command: 'Rotate',
type: 'tool',
text: 'Rotate',
iconClasses: 'fa fa-rotate',
//svgUrl: `${Icons}#icon-tools-stack-scroll`,
svgUrl: `${Icons}#3d-rotate`,
active: true
}],
activeCommand: 'Rotate'

View File

@ -131,22 +131,27 @@ class OHIFVTKViewport extends Component {
frameIndex
);
let imageDataObject;
let labelmapDataObject;
let doneLoadingCallback;
let callbacks;
switch (sopClassUid) {
case SOP_CLASSES.SEGMENTATION_STORAGE:
throw new Error("Not yet implemented");
const data = handleSegmentationStorage(stack.imageIds, displaySetInstanceUid, cornerstone);
const imageDataObject = data.referenceDataObject;
const labelmapDataObject = data.labelmapDataObject;
imageDataObject = data.referenceDataObject;
labelmapDataObject = data.labelmapDataObject;
const doneLoadingCallback = () => {
doneLoadingCallback = () => {
resolve({
data: imageDataObject.vtkImageData,
labelmap: labelmapDataObject
});
};
const callbacks = [
callbacks = [
doneLoadingCallback
];
@ -154,14 +159,14 @@ class OHIFVTKViewport extends Component {
break;
default:
const imageDataObject = getImageData(stack.imageIds, displaySetInstanceUid, cornerstone);
const doneLoadingCallback = () => {
imageDataObject = getImageData(stack.imageIds, displaySetInstanceUid, cornerstone);
doneLoadingCallback = () => {
resolve({
data: imageDataObject.vtkImageData,
});
};
const callbacks = [
callbacks = [
doneLoadingCallback
];

View File

@ -1,6 +1,4 @@
import OHIF from 'ohif-core';
import cornerstone from 'cornerstone-core';
import cornerstoneTools from 'cornerstone-tools';
import * as dcmjs from 'dcmjs';
const { StackManager } = OHIF.utils;

View File

@ -6849,10 +6849,10 @@ react-transition-group@^2.0.0, react-transition-group@^2.2.0:
prop-types "^15.6.2"
react-lifecycles-compat "^3.0.4"
react-viewerbase@^0.2.10:
version "0.2.10"
resolved "https://registry.yarnpkg.com/react-viewerbase/-/react-viewerbase-0.2.10.tgz#b6b6ec12b5568982d13b0a9733312fd39b68e121"
integrity sha512-daTLjCW4natY7cPatA/4AGyRanu+PyREYt5qI0YRRwCFtIcZTFnCYfZWX9hn6oXmbHiO5ceHzwa9i4x7oCEfkw==
react-viewerbase@^0.2.11:
version "0.2.11"
resolved "https://registry.yarnpkg.com/react-viewerbase/-/react-viewerbase-0.2.11.tgz#1015bb6c2876b2ce1a40dece8d614f7266d9fcb1"
integrity sha512-s2Nr3VSjANIvalhTPKn2CUoHzDpKiHl81BYYEFdcAt20chTmpBRlH6J6uQ7rrxpO8Iz3OblpWinNJf9+6E0pDg==
dependencies:
"@babel/runtime" "^7.2.0"
classnames "^2.2.6"
@ -6865,12 +6865,14 @@ react-viewerbase@^0.2.10:
react-dnd-html5-backend "^7.0.2"
react-with-direction "^1.3.0"
"react-vtkjs-viewport@file:.yalc/react-vtkjs-viewport":
version "0.0.5-d97d50b1"
react-vtkjs-viewport@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/react-vtkjs-viewport/-/react-vtkjs-viewport-0.0.7.tgz#8fcb3adfc6609d6e3fc6d5af94d59cb1ec4426c0"
integrity sha512-rlum/DCr5hwX4CcWXOG4HuMeD3c5ebU7eWhQRhetfcmljatCMt1oKctt+JLqllvSrpzr8lHpRG95Ek2KH12JEA==
dependencies:
cornerstone-core "^2.2.8"
cornerstone-math "^0.1.8"
vtk.js "^8.3.10"
vtk.js "^8.3.11"
react-with-direction@^1.3.0:
version "1.3.0"
@ -8710,10 +8712,10 @@ vfile@^3.0.0:
unist-util-stringify-position "^1.0.0"
vfile-message "^1.0.0"
vtk.js@^8.3.10:
version "8.3.10"
resolved "https://registry.yarnpkg.com/vtk.js/-/vtk.js-8.3.10.tgz#d5f99940ea46b7f54de49bce3482b9afb7c3ca83"
integrity sha512-pF71oKAjfMNKiP3RNw49dgT3Y50zSwAfCqM4Z1+ggx+So8Nf/0XZZe7I8SV+t/QntX8NaSzvbRDxG/fqnRrZ8w==
vtk.js@^8.3.11:
version "8.3.15"
resolved "https://registry.yarnpkg.com/vtk.js/-/vtk.js-8.3.15.tgz#060b355c1a811229ec0e43ef69b63915d0e1da8e"
integrity sha512-mbsajcTnRgIGmWtcSdGqzYLdrRVrLE7YjdNcvDybLM9JNTVXEngHzeWuNZGYqklPAGcCsckaZ3FzYqu/EH4UBA==
dependencies:
base64-js "1.2.1"
blueimp-md5 "2.10.0"

View File

@ -15,7 +15,7 @@
"npm": ">=5"
},
"scripts": {
"build": "rollup -c",
"build": "node --max-old-space-size=8192 node_modules/rollup/bin/rollup -c",
"prepublishOnly": "npm run build",
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}",
"prepare": "npm run build",
@ -98,19 +98,20 @@
"classnames": "^2.2.6",
"cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8",
"cornerstone-tools": "^3.2.3",
"cornerstone-tools": "^3.2.4",
"cornerstone-wado-image-loader": "^2.2.3",
"dcmjs": "^0.3.4",
"dcmjs": "^0.3.6",
"dicom-parser": "^1.8.3",
"dicomweb-client": "^0.4.2",
"hammerjs": "^2.0.8",
"lodash.isequal": "^4.5.0",
"moment": "^2.24.0",
"ohif-core": "^0.3.4",
"ohif-core": "^0.3.5",
"ohif-cornerstone-extension": "^0.0.20",
"ohif-dicom-html-extension": "^0.0.2",
"ohif-dicom-microscopy-extension": "^0.0.5",
"ohif-dicom-pdf-extension": "^0.0.6",
"ohif-vtk-extension": "^0.0.1",
"oidc-client": "^1.6.1",
"prop-types": "^15.6.2",
"react-bootstrap-modal": "^4.2.0",
@ -120,7 +121,8 @@
"react-resize-detector": "^3.4.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-viewerbase": "^0.2.10",
"react-viewerbase": "^0.2.11",
"react-vtkjs-viewport": "^0.0.7",
"redux": "^4.0.1",
"redux-oidc": "^3.1.0"
}

View File

@ -234,4 +234,7 @@
<title>Password</title>
<path d="M5 12h8v-3c0-2.203-1.797-4-4-4s-4 1.797-4 4v3zM18 13.5v9c0 0.828-0.672 1.5-1.5 1.5h-15c-0.828 0-1.5-0.672-1.5-1.5v-9c0-0.828 0.672-1.5 1.5-1.5h0.5v-3c0-3.844 3.156-7 7-7s7 3.156 7 7v3h0.5c0.828 0 1.5 0.672 1.5 1.5z"></path>
</symbol>
<symbol id='cube' viewBox="-205 207 100 100"><!--cube by Gregor Cresnar from the Noun Project https://thenounproject.com/search/?q=cube&i=197684 !--><path d="M-115.1,280.3c0-0.1,0.1-0.1,0.1-0.2c0,0,0-0.1,0-0.1c0-0.1,0-0.2,0-0.3c0,0,0,0,0,0l0.1-45 c0-0.5-0.3-0.9-0.7-1.2L-154,211c-0.1,0-0.1,0-0.2-0.1c0,0,0,0,0,0c-0.4-0.2-0.8-0.1-1.2,0.1l-38.8,22.1 c-0.4,0.2-0.7,0.7-0.7,1.2l-0.3,44.6c0,0.5,0.3,0.9,0.7,1.2l38.7,22.9c0.2,0.1,0.5,0.2,0.7,0.2c0.2,0,0.5-0.1,0.7-0.2l38.8-22.1 c0,0,0,0,0,0c0.1,0,0.1-0.1,0.2-0.1c0.1,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2C-115.1,280.4-115.1,280.4-115.1,280.3z M-160.7,296.9c1.5-1.5,3-3,4.5-4.6l0,2.4c-1,1-2,2-3,3L-160.7,296.9z M-163.9,295c2.5-2.6,5.1-5.1,7.6-7.7l0,2.4 c-2,2.1-4.1,4.1-6.1,6.2L-163.9,295z M-167,293.2c3.6-3.6,7.1-7.2,10.7-10.8l0,2.4c-2.6,2.6-5.2,5.2-7.7,7.8 c-0.5,0.5-1,1-1.5,1.5L-167,293.2z M-170.1,291.3c4.6-4.7,9.2-9.3,13.8-14l0,2.4c-4.1,4.2-8.2,8.3-12.3,12.5L-170.1,291.3z M-173.3,289.5C-173.2,289.4-173.2,289.4-173.3,289.5c5.7-5.7,11.3-11.4,17-17.1l0,2.4c-5.1,5.2-10.3,10.4-15.4,15.6c0,0,0,0,0,0 L-173.3,289.5z M-176.4,287.6C-176.4,287.6-176.4,287.6-176.4,287.6c6.7-6.8,13.4-13.6,20.1-20.3l0,2.4 c-6.1,6.2-12.3,12.4-18.4,18.6c-0.1,0.1-0.1,0.1-0.1,0.2L-176.4,287.6z M-179.5,285.7C-179.5,285.7-179.5,285.7-179.5,285.7 c7.7-7.8,15.5-15.6,23.2-23.4l0,2.4c-7.2,7.3-14.4,14.5-21.5,21.8c0,0-0.1,0.1-0.1,0.1L-179.5,285.7z M-182.7,283.9 C-182.6,283.9-182.6,283.8-182.7,283.9c8.7-8.9,17.4-17.6,26.1-26.4l0.2,0.1l0,2.1c-8.2,8.3-16.4,16.6-24.7,25 c0,0-0.1,0.1-0.1,0.1L-182.7,283.9z M-185.8,282.1c0.1-0.1,0.1-0.2,0.2-0.2c8.5-8.6,17-17.2,25.6-25.9c0.1-0.1,0.2-0.2,0.3-0.3 l1.5,0.9c-8.6,8.7-17.3,17.5-25.9,26.2c0,0-0.1,0.1-0.1,0.2L-185.8,282.1z M-188.9,280.2c0-0.1,0.1-0.1,0.1-0.2 c8.6-8.7,17.3-17.5,25.9-26.2l1.5,0.9c-8.6,8.7-17.3,17.5-25.9,26.2c-0.1,0.1-0.1,0.1-0.2,0.2L-188.9,280.2z M-192.1,278.3 c0.1-0.1,0.1-0.1,0.2-0.2c8.6-8.7,17.2-17.4,25.8-26.2l1.5,0.9c-8.6,8.7-17.1,17.3-25.7,26c-0.1,0.1-0.3,0.3-0.4,0.4 L-192.1,278.3z M-154.7,213.8l35.8,20.9l-36,20.5l-35.8-20.9L-154.7,213.8z M-191.2,237.2l1.5,0.9c-0.8,0.8-1.7,1.7-2.5,2.5 l0-2.4C-191.8,237.9-191.5,237.6-191.2,237.2z M-192.3,253.4c3.5-3.5,7-7.1,10.5-10.6l1.5,0.9c-4,4.1-8,8.1-12.1,12.2 L-192.3,253.4z M-192.2,250.8l0-2.4c0.9-0.9,1.8-1.9,2.8-2.8c1.5-1.6,3.1-3.1,4.6-4.7l1.5,0.9 C-186.3,244.8-189.3,247.8-192.2,250.8z M-192.2,245.7l0-2.4c1.4-1.4,2.8-2.8,4.2-4.2l1.5,0.9 C-188.4,241.9-190.3,243.8-192.2,245.7z M-178.6,244.6l1.5,0.9c-5.1,5.1-10.1,10.3-15.2,15.4l0-2.4 C-187.7,253.8-183.2,249.2-178.6,244.6z M-192.3,263.5c5.6-5.7,11.2-11.4,16.9-17.1l1.5,0.9c-6.1,6.2-12.3,12.4-18.4,18.6 L-192.3,263.5z M-192.4,268.6c6.7-6.8,13.4-13.5,20.1-20.3l1.5,0.9c-7.2,7.3-14.4,14.6-21.6,21.8L-192.4,268.6z M-192.4,273.6 c7.7-7.8,15.5-15.7,23.2-23.5l1.5,0.9c-8.3,8.4-16.5,16.7-24.8,25.1L-192.4,273.6z M-156.2,297.3l0,2.3l-1.4-0.8 C-157.1,298.2-156.7,297.7-156.2,297.3z M-153.6,257.6l36-20.5l-0.1,41.8l-35.8,20.4L-153.6,257.6z"/><path d="M-154.9,232.7C-154.8,232.7-154.8,232.7-154.9,232.7c0.8,0,1.4-0.6,1.4-1.4c0-0.8-0.6-1.4-1.4-1.4 c-0.8,0-1.4,0.6-1.4,1.4C-156.2,232.1-155.6,232.7-154.9,232.7z"/><path d="M-154.9,239.1C-154.9,239.1-154.9,239.1-154.9,239.1c0.8,0,1.4-0.6,1.4-1.4c0-0.8-0.6-1.4-1.4-1.4 c-0.8,0-1.4,0.6-1.4,1.4C-156.3,238.4-155.7,239.1-154.9,239.1z"/><path d="M-155,249.1c-0.8,0-1.4,0.6-1.4,1.4c0,0.8,0.6,1.4,1.4,1.4c0,0,0,0,0,0c0.7,0,1.4-0.6,1.4-1.4 C-153.6,249.7-154.2,249.1-155,249.1z"/><path d="M-154.9,245.4C-154.9,245.4-154.9,245.4-154.9,245.4c0.8,0,1.4-0.6,1.4-1.4c0-0.8-0.6-1.4-1.4-1.4 c-0.8,0-1.4,0.6-1.4,1.4C-156.3,244.8-155.7,245.4-154.9,245.4z"/><path d="M-154.8,219.9C-154.8,219.9-154.8,219.9-154.8,219.9c0.8,0,1.4-0.6,1.4-1.4c0-0.8-0.6-1.4-1.4-1.4 c-0.8,0-1.4,0.6-1.4,1.4C-156.2,219.3-155.5,219.9-154.8,219.9z"/><path d="M-154.8,226.3C-154.8,226.3-154.8,226.3-154.8,226.3c0.8,0,1.4-0.6,1.4-1.4c0-0.8-0.6-1.4-1.4-1.4 c-0.8,0-1.4,0.6-1.4,1.4C-156.2,225.7-155.6,226.3-154.8,226.3z"/><path d="M-148.8,258.9c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-147.9,260.1-148.1,259.3-148.8,258.9z"/><path d="M-121.1,275.3c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-120.2,276.5-120.5,275.7-121.1,275.3z"/><path d="M-126.6,272c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-125.8,273.2-126,272.4-126.6,272z"/><path d="M-143.2,262.2c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-142.4,263.4-142.6,262.6-143.2,262.2z"/><path d="M-132.2,268.7c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-131.3,270-131.5,269.1-132.2,268.7z"/><path d="M-137.7,265.5c-0.7-0.4-1.5-0.2-1.9,0.5c-0.4,0.7-0.2,1.5,0.5,1.9c0.2,0.1,0.5,0.2,0.7,0.2 c0.5,0,0.9-0.2,1.2-0.7C-136.8,266.7-137.1,265.8-137.7,265.5z"/></symbol>
<symbol id='3d-rotate' viewBox="0 0 24 30"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M17.856,11.409c-0.004-0.127-0.006-0.165-0.013-0.335l-0.01-0.195 c0.001,0.02-0.01-0.159-0.008-0.14l-0.004-0.06l-1.214,0.08v0.004c0.005,0.071,0.009,0.137,0.013,0.209 c0-0.001,0.025,0.732,0.025,0.731l0.001,0.025l-0.001-0.01l0.001,0.029v0.021v-0.01v0.03v-0.009v0.03v-0.01l0.001,0.035 l-0.001-0.01l0.001,0.04v-0.01v0.045v-0.01v0.06V11.94V12c0,0.925-0.066,1.891-0.214,2.85c0.443-0.125,0.877-0.272,1.288-0.444 c0.097-0.8,0.143-1.604,0.143-2.405c-0.001-0.127-0.002-0.254-0.004-0.381L17.856,11.409L17.856,11.409z M5.386,16.674L2,15.691 l0.658-0.711C1.817,14.19,1.2,13.182,1.2,12c0.006-0.916,0.35-1.691,0.912-2.399c0.83-1.011,2.014-1.758,3.339-2.293 C5.335,7.792,5.239,8.281,5.162,8.774C4.584,9.066,4.053,9.41,3.592,9.812c-0.563,0.5-1.035,1.118-1.149,1.862 c-0.076,0.5,0.027,0.975,0.259,1.417c0.197,0.374,0.478,0.711,0.782,0.995l0.657-0.711L5.386,16.674L5.386,16.674z M9.6,6.283 C10.44,6.18,11.256,6.135,12,6.135c1.765,0,3.552,0.222,5.246,0.722C19.566,7.542,22.783,9.189,22.8,12 c-0.006,0.915-0.349,1.69-0.911,2.398c-2.151,2.622-6.685,3.467-9.889,3.467c-0.89,0-1.822-0.054-2.697-0.182l0.165-1.205 c0.82,0.12,1.699,0.17,2.533,0.17c2.71,0,6.298-0.621,8.408-2.46c0.644-0.572,1.167-1.297,1.175-2.188 c-0.013-1.455-1.41-2.516-2.574-3.134C16.924,7.773,14.333,7.351,12,7.351c-0.884,0-1.862,0.066-2.852,0.219 C9.275,7.128,9.425,6.697,9.6,6.283L9.6,6.283z M15.224,18.834c0.486-0.076,0.975-0.169,1.459-0.283 c-0.85,2.063-2.374,4.235-4.683,4.249c-0.916-0.006-1.691-0.349-2.399-0.911C6.979,19.737,6.135,15.204,6.135,12 c0-1.764,0.222-3.552,0.722-5.246C7.542,4.434,9.189,1.217,12,1.2c1.454,0,2.627,0.926,3.466,2.038l0.778-0.577l0.61,3.471 L13.71,4.539l0.778-0.577C13.907,3.175,13.023,2.417,12,2.417c-1.455,0.013-2.516,1.411-3.134,2.575 C7.773,7.076,7.351,9.667,7.351,12c0,2.71,0.621,6.298,2.461,8.408c0.572,0.644,1.296,1.167,2.188,1.175 c1.455-0.013,2.516-1.41,3.134-2.574L15.224,18.834z"/></g>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -9,7 +9,7 @@ import ui from './redux/ui.js';
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
import WhiteLabellingContext from './WhiteLabellingContext';
import OHIFCornerstoneExtension from 'ohif-cornerstone-extension';
//import OHIFVTKExtension from 'ohif-vtk-extension';
import OHIFVTKExtension from 'ohif-vtk-extension';
import OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension';
import OHIFDicomMicroscopyExtension from 'ohif-dicom-microscopy-extension';
@ -147,7 +147,7 @@ store.dispatch(toolAction);
/** TODO: extensions should be passed in as prop as soon as we have the extensions as separate packages and then registered by ExtensionsManager */
const extensions = [
new OHIFCornerstoneExtension(),
//new OHIFVTKExtension(),
new OHIFVTKExtension(),
new OHIFDicomPDFExtension(),
new OHIFDicomHtmlExtension(),
new OHIFDicomMicroscopyExtension()

View File

@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import PluginSwitch from './PluginSwitch.js';
import OHIF from 'ohif-core'
import OHIF from 'ohif-core';
const { setLayout } = OHIF.redux.actions;
@ -15,8 +15,8 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
setLayout: (data) => {
dispatch(setLayout(data))
setLayout: data => {
dispatch(setLayout(data));
}
};
};
@ -36,20 +36,31 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
// TODO: Do not display certain options if the current display set
// cannot be displayed using these view types
const options = [
const Icons = 'icons.svg';
const buttons = [
{
title: 'Original Acquisition',
onClick: (click) => {
text: 'Acquired',
type: 'command',
iconClasses: 'fa fa-bars',
active: false,
onClick: click => {
console.warn('Original Acquisition');
const layoutData = setSingleLayoutData(layout.viewports, activeViewportIndex, { plugin: 'cornerstone'});
const layoutData = setSingleLayoutData(
layout.viewports,
activeViewportIndex,
{ plugin: 'cornerstone' }
);
setLayout({ viewports: layoutData });
}
},
{
title: 'Axial',
onClick: (click) => {
text: 'Axial',
svgUrl: `${Icons}#cube`,
svgClasses: 'icon-rotate-120',
active: false,
onClick: click => {
console.warn('Axial');
const data = {
plugin: 'vtk',
@ -59,14 +70,20 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
}
};
const layoutData = setSingleLayoutData(layout.viewports, activeViewportIndex, data);
const layoutData = setSingleLayoutData(
layout.viewports,
activeViewportIndex,
data
);
setLayout({ viewports: layoutData });
}
},
{
title: 'Sagittal',
onClick: (click) => {
text: 'Sagittal',
svgUrl: `${Icons}#cube`,
active: false,
onClick: click => {
console.warn('Sagittal');
const data = {
plugin: 'vtk',
@ -76,14 +93,21 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
}
};
const layoutData = setSingleLayoutData(layout.viewports, activeViewportIndex, data);
const layoutData = setSingleLayoutData(
layout.viewports,
activeViewportIndex,
data
);
setLayout({ viewports: layoutData });
}
},
{
title: 'Coronal',
onClick: (click) => {
text: 'Coronal',
svgUrl: `${Icons}#cube`,
svgClasses: 'fa-rotate-90 fa-flip-horizontal',
active: false,
onClick: click => {
console.warn('Coronal');
const data = {
plugin: 'vtk',
@ -93,13 +117,18 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
}
};
const layoutData = setSingleLayoutData(layout.viewports, activeViewportIndex, data);
const layoutData = setSingleLayoutData(
layout.viewports,
activeViewportIndex,
data
);
setLayout({ viewports: layoutData });
}
},
{
title: '3D Perspective',
}
/*{
text: '3D',
svgUrl: `${Icons}#cube`,
onClick: (click) => {
console.warn('3D Perspective');
const data = {
@ -113,11 +142,11 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
setLayout({ viewports: layoutData });
}
}
}*/
];
return {
options,
buttons
};
};

View File

@ -0,0 +1,3 @@
.icon-rotate-120 {
transform: rotate(120deg);
}

View File

@ -1,19 +1,19 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Dropdown } from 'react-viewerbase';
import { ExpandableToolMenu } from 'react-viewerbase';
import './PluginSwitch.css';
class PluginSwitch extends Component {
static propTypes = {
options: PropTypes.array,
buttons: PropTypes.array
};
static defaultProps = {
};
static defaultProps = {};
render() {
return (
<div className="PluginSwitch">
{this.props.options && <Dropdown title={"View"} list={this.props.options}/>}
<ExpandableToolMenu buttons={this.props.buttons} />
</div>
);
}

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import OHIF from 'ohif-core';
import { RoundedButtonGroup } from 'react-viewerbase';
import ConnectedLayoutButton from './ConnectedLayoutButton';
///import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
import './ToolbarRow.css';
const Icons = 'icons.svg';
@ -64,17 +64,15 @@ class ToolbarRow extends Component {
const { PLUGIN_TYPES, availablePlugins } = OHIF.plugins;
const plugin = availablePlugins.find(entry => {
return (
entry.type === PLUGIN_TYPES.TOOLBAR &&
entry.id === currentPluginId
entry.type === PLUGIN_TYPES.TOOLBAR && entry.id === currentPluginId
);
});
let pluginComp;
if (plugin) {
const PluginComponent = plugin.component;
pluginComp = <PluginComponent/>
pluginComp = <PluginComponent />;
}
return (
@ -86,9 +84,9 @@ class ToolbarRow extends Component {
onValueChanged={this.onLeftSidebarValueChanged}
/>
</div>
{ pluginComp }
{pluginComp}
<ConnectedLayoutButton />
{/*<ConnectedPluginSwitch/>*/}
<ConnectedPluginSwitch />
<div className="pull-right m-t-1 rm-x-1" style={{ marginLeft: 'auto' }}>
<RoundedButtonGroup
options={rightSidebarToggle}

View File

@ -1 +1 @@
export default '416ecb659362a0ebf5449109186c55511421cc33';
export default '932fcea446e27f11483b8dd4a411ada481fcc6ec';

View File

@ -1 +1 @@
export default '0.0.17';
export default '0.0.18';

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit 05f58a4be2d7f90671d71a2c5cf96a2f08bb219d
Subproject commit 95baddeb8c2c3ca94e8168146f5e88612eadb7ab

@ -1 +1 @@
Subproject commit 3fe82ecec15dc3e1843a00b0d88da8f3f7e161c4
Subproject commit a97200c7af92ca37d55cec13f65cf593e3d6b8dc

@ -1 +1 @@
Subproject commit 8d1a0b11e5e565f779f12082d24ca8f9daa0b051
Subproject commit 09b6fb77ae73ee7927bf7bd4324925aef38d4242