insight-viewer
A React component for DICOM images
Install
You need to add NPM_TOKEN to your environment variables. Please ask the token to @syyu.
export NPM_TOKEN="00000000-0000-0000-0000-000000000000"
Use Yarn instead of npm.
yarn add @lunit/insight-viewer
Usage
import React, { Component } from 'react'
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 (
<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>
)
}
}
See Insight MMG for more usages.
Author
@syyu