2019-10-29 19:21:56 +01:00
|
|
|
import OHIF from '@ohif/core';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import DicomHtmlViewport from './DicomHtmlViewport';
|
|
|
|
|
|
|
|
|
|
const { setViewportActive } = OHIF.redux.actions;
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state, ownProps) => {
|
|
|
|
|
const { viewportIndex, byteArray } = ownProps;
|
2019-12-02 17:29:04 +01:00
|
|
|
const { activeViewportIndex } = state.viewports;
|
2019-10-29 19:21:56 +01:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
viewportIndex,
|
|
|
|
|
activeViewportIndex,
|
|
|
|
|
byteArray,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => {
|
|
|
|
|
const { viewportIndex } = ownProps;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
setViewportActive: () => {
|
|
|
|
|
dispatch(setViewportActive(viewportIndex));
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const ConnectedDicomHtmlViewport = connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps
|
|
|
|
|
)(DicomHtmlViewport);
|
|
|
|
|
|
|
|
|
|
export default ConnectedDicomHtmlViewport;
|