[OHIF-Viewers]医疗数字阅片-医学影像-数字胶片直接下载,不再弹窗进行设置
[OHIF-Viewers]医疗数字阅片-医学影像-数字胶片直接下载,不再弹窗进行设置
直接下载解决方案
\Viewers\extensions\cornerstone\src\commandsModule.js
showDownloadViewportModal: ({ viewports }) => {// 改变尺寸function doResize(width, height,el) {if (width < 100)width = 100if (height < 100)height = 100el.style.width = width + 'px';el.style.height = height + 'px';cornerstone.resize(el);}const activeViewportIndex = viewports.activeViewportIndex;const activeViewport = getEnabledElement(activeViewportIndex);const enabledElement = cornerstone.getEnabledElement(activeViewport);const viewport = Object.assign({}, enabledElement.viewport);delete viewport.scale;viewport.translation = {x: 0,y: 0,};const viewportElement = document.querySelector(".cornerstone-canvas-nn");cornerstone.enable(viewportElement); // 初始化// 插入数据cornerstone.loadAndCacheImage(enabledElement.image.imageId).then(function(image) {cornerstone.displayImage(viewportElement, image); //插入图片cornerstone.setViewport(viewportElement, viewport);//设置视图,设置现在显示的状态,如旋转等cornerstone.resize(viewportElement, true);//先自适应调整一次,保证视图完整});//插入数据后,再执行尺寸的改变doResize(512,512,viewportElement) // 改变尺寸console.log(viewportElement);//延时setTimeout(function () {// alert('VIDEO HAS STOPPED');console.log("延迟执行");console.log(viewportElement.querySelector('canvas').toDataURL()); // 打印数据// console.log(document.querySelector("#root > div.FlexboxLayout > div.main-content > div > div > div > div.cornerstone-canvas-nn > canvas").toDataURL()); //绝对地址定位viewportElement.querySelector('canvas').toBlob(blob => {const URLObj = window.URL || window.webkitURL;const a = document.createElement('a');a.href = URLObj.createObjectURL(blob);a.download = 'imgs.jpg';document.body.appendChild(a);a.click();document.body.removeChild(a);});cornerstone.invalidate(viewportElement); // 删除el,一定要删除,不然连续下载,因为原始尺寸会产生插入数据不完整}, 500);},
Viewers\extensions\cornerstone\src\OHIFCornerstoneViewport.js
此位置添加cornerstone-canvas-nn标签
测试过动态创建标签,但无法渲染出数据。document.createElement('div');
<div className={"cornerstone-canvas-nn"} style={{position: 'absolute',left: '9999px'}}> </div>
[OHIF-Viewers]医疗数字阅片-医学影像-数字胶片直接下载,不再弹窗进行设置相关推荐
- [OHIF-Viewers]医疗数字阅片-医学影像-事件总线管理器
[OHIF-Viewers]医疗数字阅片-医学影像-事件总线管理器 添加按钮>调用命令>注册回调函数 App.js import React, { Component } from 're ...
- [OHIF-Viewers]医疗数字阅片-医学影像-cornerstone-core-Cornerstone.js提供了一个完整的基于Web的医学成像平台。...
[OHIF-Viewers]医疗数字阅片-医学影像-cornerstone-core-Cornerstone.js提供了一个完整的基于Web的医学成像平台. 还必须写中文,不然不让同步,蛋疼呀--- ...
- [OHIF-Viewers]医疗数字阅片-医学影像-es6解构赋值-const{}=-let{}=
[OHIF-Viewers]医疗数字阅片-医学影像-es6解构赋值-const{}=-let{}= 解构赋值语法是一种 Javascript 表达式.通过解构赋值, 可以将属性/值从对象/数组中取出, ...
- [OHIF-Viewers]医疗数字阅片-医学影像-es6-Element.querySelector()
[OHIF-Viewers]医疗数字阅片-医学影像-es6-Element.querySelector() https://developer.mozilla.org/zh-CN/docs/Web/A ...
- [OHIF-Viewers]医疗数字阅片-医学影像-querySelector() 选择器语法-将画布(canvas)图像保存成本地图片的方法...
[OHIF-Viewers]医疗数字阅片-医学影像-querySelector() 选择器语法-将画布(canvas)图像保存成本地图片的方法 将画布(canvas)图像保存成本地图片的方法 使用HT ...
- [OHIF-Viewers]医疗数字阅片-医学影像-使用 PropTypes 进行类型检查
[OHIF-Viewers]医疗数字阅片-医学影像-使用 PropTypes 进行类型检查 注意: 自 React v15.5 起,React.PropTypes 已移入另一个包中.请使用 prop- ...
- [OHIF-Viewers]医疗数字阅片-医学影像-REACT-Hook API索引
[OHIF-Viewers]医疗数字阅片-医学影像-REACT-Hook API索引 Hook 是 React 16.8 的新增特性.它可以让你在不编写 class 的情况下使用 state 以及其他 ...
- [OHIF-Viewers]医疗数字阅片-医学影像-中间插播一下-es6-使用const加箭头函数声明函数相对于function声明函数有什么好处?...
[OHIF-Viewers]医疗数字阅片-医学影像-中间插播一下-es6-使用const加箭头函数声明函数相对于function声明函数有什么好处? 这个好多人都已经写过了,这里插播一下,在OHIF- ...
- [OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-中二-Reduxreact-redux状态管理详解...
[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-中二-Redux&react-redux状态管理详解 先上官方文档,推荐阅读英文原版文档,是最新.最 ...
最新文章
- 证明利用快慢指针寻找有环单链表中环的起点算法
- C++ 容器 LIST VECTOR erase
- 【机器学习基础】浅析机器学习集成学习与模型融合
- python用户界面导入图片_python学习笔记之11:图像用户界面
- python 取一个字前的文本的_python删除某一行字符前面的内容
- 单片机与PC机一样都是计算机,51单片机与PC机通信资料
- iptable 详解_最全的iptables防火墙详解.pdf
- 数组长度属性以及JavaScript中的示例
- Centos7 下定义MariaDB源Yum安装最新版本的MariaDB
- Java List相关用法
- 洛谷p1338末日的传说(思维好题,数学)
- Flask-----轻量级的框架,快速的搭建程序
- 字体图标的使用(HTML、CSS)
- Web开发编程语言是最适合新手的吗-开课吧
- python传大文件如何检查遗漏,如何使用Python获取大文件的实时复制进度?
- 数据结构c语言作业答案,数据结构C语言版第2版习题答案解析严蔚敏
- 说说数据一致性有哪几种?
- 25本最佳个人理财书籍
- BlueCoat ProxySG配置FTP代理
- 钕铁硼表面处理之—钝化