import { Component } from 'react'; import React from 'react'; import './ViewportOverlay.css'; import PropTypes from 'prop-types'; class ViewportOverlay extends Component { render() { const scale = Math.round(this.props.viewport.scale * 100) / 100; const imageId = this.props.imageId; /*const patientId = cornerstone.metaData.get('00100020', imageId); const studyDate = cornerstone.metaData.get('00080020', imageId); const collection = cornerstone.metaData.get('00131010', imageId); const studyDescription = cornerstone.metaData.get('00081030', imageId);*/ const windowWidth = Math.round(this.props.viewport.voi.windowWidth); const windowCenter = Math.round(this.props.viewport.voi.windowCenter); const imagesLeft = this.props.stack.imageIds.length - this.props.numImagesLoaded; return (
{this.props.patientId} {this.props.studyDate} {this.props.studyDescription} {imagesLeft > 0 ? `${imagesLeft} images remaining...` : ''}
Zoom: {scale}
WW/WC: {windowWidth} / {windowCenter} Image: {this.props.stack.currentImageIdIndex + 1} /{' '} {this.props.stack.imageIds.length}
); } } ViewportOverlay.propTypes = { viewport: PropTypes.object.isRequired, imageId: PropTypes.string.isRequired, stack: PropTypes.object.isRequired }; export default ViewportOverlay;