@lunit/insight-viewer
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -215,3 +215,3 @@ import * as dicomParser from 'dicom-parser'; | ||
_this.onResize = function () { | ||
if (!_this.props.imageId) { | ||
if (!_this.state.enabledElement) { | ||
return; | ||
@@ -251,2 +251,3 @@ } | ||
loadImage(this.props.imageId).then(function (image) { | ||
image.voiLUT = undefined; // remove VOI LUT for 'adjust' functionality | ||
displayImage(_this2.element, image); | ||
@@ -253,0 +254,0 @@ var viewport = getViewport(_this2.element); |
@@ -220,3 +220,3 @@ 'use strict'; | ||
_this.onResize = function () { | ||
if (!_this.props.imageId) { | ||
if (!_this.state.enabledElement) { | ||
return; | ||
@@ -256,2 +256,3 @@ } | ||
cornerstone.loadImage(this.props.imageId).then(function (image) { | ||
image.voiLUT = undefined; // remove VOI LUT for 'adjust' functionality | ||
cornerstone.displayImage(_this2.element, image); | ||
@@ -258,0 +259,0 @@ var viewport = cornerstone.getViewport(_this2.element); |
{ | ||
"name": "@lunit/insight-viewer", | ||
"version": "1.0.1", | ||
"description": "", | ||
"version": "1.0.2", | ||
"description": "A React component for DICOM images", | ||
"author": { | ||
@@ -44,2 +44,4 @@ "name": "SangYeob Yu", | ||
"cross-env": "^5.1.4", | ||
"enzyme": "^3.3.0", | ||
"enzyme-adapter-react-16": "^1.1.1", | ||
"eslint": "^4.19.1", | ||
@@ -46,0 +48,0 @@ "eslint-config-standard": "^11.0.0", |
# insight-viewer | ||
> | ||
> A React component for DICOM images | ||
[![NPM](https://img.shields.io/npm/v/insight-viewer.svg)](https://www.npmjs.com/package/insight-viewer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
@@ -10,3 +10,3 @@ ## Install | ||
```bash | ||
npm install --save insight-viewer | ||
npm install --save @lunit/insight-viewer | ||
``` | ||
@@ -19,8 +19,29 @@ | ||
import MyComponent from 'insight-viewer' | ||
import Viewer, { HeatmapLayer, MagnifyLayer } from '@lunit/insight-viewer' | ||
class Example extends Component { | ||
constructor (props) { | ||
super(props) | ||
this.state = { | ||
controls: { | ||
mouseMode: 'pan', | ||
invert: false, | ||
fliped: false | ||
}, | ||
resetFlag: false, | ||
imageId: 'wadouri:[dicom file uri]', | ||
heatmapEnabled: false, | ||
posMap: [[]], | ||
threshold: 0.1, | ||
magnifyEnabled: false | ||
} | ||
} | ||
render () { | ||
return ( | ||
<MyComponent /> | ||
<Viewer imageId={this.state.imageId} controlState={this.state.controls} | ||
resetFlag={this.state.resetFlag}> | ||
<HeatmapLayer enabled={this.state.heatmapEnabled} | ||
posMap={this.state.posMap} threshold={this.state.threshold} /> | ||
<MagnifyLayer enabled={this.state.magnifyEnabled} /> | ||
</Viewer> | ||
) | ||
@@ -31,4 +52,6 @@ } | ||
## License | ||
See [Insight MMG](https://github.com/lunit-io/insight-front/tree/develop/packages/insight-mmg) for more usages. | ||
MIT © [deminoth](https://github.com/deminoth) | ||
## Author | ||
[@syyu](https://github.com/deminoth) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47769
1145
55
28