[OHIF-Viewers]医疗数字阅片-医学影像-es6解构赋值-const{}=-let{}= 解构赋值语法是一种 Javascript 表达式。 example(); // 返回一个对象 function example() { return { foo: 1, bar: 2 }; } let { foo, bar } = example(); 在OHIF-Viewers 里的解构 const { onAdded, //添加 onRemoved,//移除 onModified,//修改 } = OHIF.measurements.MeasurementHandlers
[OHIF-Viewers]医疗数字阅片-医学影像-事件总线管理器 添加按钮》调用命令》注册回调函数 App.js import React, { Component } from 'react'; import SnackbarProvider, ModalProvider, DialogProvider, OHIFModal, ErrorBoundary } from '@ohif /core'; import i18n from '@ohif/i18n'; // TODO: This should not be here //import '. = window.ohif || {}; window.ohif.app = { commandsManager, hotkeysManager, servicesManager, extensionManager = window.ohif || {}; window.ohif.app = { commandsManager, hotkeysManager, servicesManager, extensionManager
[OHIF-Viewers]医疗数字阅片-医学影像-获取焦点的2种方式-ref 前言 在React中,只要props或state发生改变,则render()方法必定执行,即DOM会更新。 this.getInputElement} inputGetFocus={this.getFocus} /> ) } } export default Parent OHIF
[OHIF-Viewers]医疗数字阅片-医学影像-es6-Element.querySelector() https://developer.mozilla.org/zh-CN/docs/Web/API document.getElementById("output").innerHTML = (baseElement.querySelector("div span").innerHTML); OHIF
[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上 https://docs.ohif.org/extensions/modules/panel.html Module
[OHIF-Viewers]医疗数字阅片-医学影像-redux-token实操 需要更改地方 修改: platform/core/src/redux/actions.js 修改: platform/core default: return state; } }; export default Token; src/App.js +import {setToken} from "@ohif
[OHIF-Viewers]医疗数字阅片-医学影像-中间插播一下-es6-使用const加箭头函数声明函数相对于function声明函数有什么好处? 这个好多人都已经写过了,这里插播一下,在OHIF-Viewers里面有很多这样的写法,当然OHIF-Viewers维护者众多,有人用这种新的写法也有原始的写法,各种历史遗留的写法问题。 OHIF-Viewers项目,跟着博主此系列博文也可加快学习OHIF-Viewers的进度。 此前也写了一篇[OHIF-Viewers]医疗数字阅片-医学影像-ES6箭头函数(=>) ES6中,除了let和const新特性,箭头函数是使用频率最高的新特性了。
[OHIF-Viewers]医疗数字阅片-医学影像-屏蔽StudyList病例列表 Viewers/platform/viewer/public/config/default.js 找到showStudyList
[OHIF-Viewers]医疗数字阅片-医学影像-querySelector() 选择器语法-将画布(canvas)图像保存成本地图片的方法 将画布(canvas)图像保存成本地图片的方法 使用HTML5 OHIF图片下载按钮改写为直接下载图片: 事件》CornerstoneViewportDownloadForm.js》ViewportDownloadForm.js 采用绝对定位 document.querySelector
[OHIF-Viewers]医疗数字阅片-医学影像-数字胶片直接下载,不再弹窗进行设置 直接下载解决方案 \Viewers\extensions\cornerstone\src\commandsModule.js
[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-中二-Redux&react-redux状态管理详解 先上官方文档,推荐阅读英文原版文档,是最新、最全、最官方的文档 { type: TOGGLE_TODO, index: 5 } OHIF-Viewers是定义的action type 常量 我们应该尽量减少在 action 中传递的数据。 SET_VISIBILITY_FILTER, filter: SHOW_COMPLETED } Action 创建函数 关于是用const定义还是写之前的function定义比较问题,请看此博文: [OHIF-Viewers OHIF-Viewers就是采用的bindActionCreators() 方式进行绑定的。 Action 创建函数也可以是异步非纯函数。
[OHIF-Viewers]医疗数字阅片-医学影像-辅助工具-Redux DevTools-DevTools for Redux with hot reloading, action replay, and
[OHIF-Viewers]医疗数字阅片-医学影像-Redux中的reducer到底是什么,以及它为什么叫reducer?
[OHIF-Viewers]医疗数字阅片-医学影像-使用 PropTypes 进行类型检查 注意: 自 React v15.5 起,React.PropTypes 已移入另一个包中。
/ViewportDownloadForm.styl'; import { TextInput, Select, Icon } from '@ohif/ui'; import classnames from
[OHIF-Viewers]医疗数字阅片-医学影像-REACT-Hook API索引 Hook 是 React 16.8 的新增特性。 useReducer useCallback useMemo useRef useImperativeHandle useLayoutEffect useDebugValue 基础 Hook useState OHIF-Viewers
[OHIF-Viewers]医疗数字阅片-医学影像-REACT-React.createRef()-Refs and the DOM关于回调 refs 的说明 const [downloadCanvas
OHIF-Viewers里面有一句 import throttle from 'lodash.throttle'; 先找手册,这里贴中文的手册地址吧,看着方便一点 https://www.lodashjs.com
[OHIF-Viewers]医疗数字阅片-医学影像-cornerstone-core-Cornerstone.js-Cornerstone Examples-基石实例 The following examples
[OHIF-Viewers]医疗数字阅片-医学影像-cornerstone-core-Cornerstone.js-Cornerstone Examples-基石实例-下 CT Image with Window