| 患者姓名 | 63 |患者id | 64 |Study 日期 | 65 |状态 | 66 |Study 描述 | 67 |# 图像 | 68 |
|---|
├── _config.yml ├── .gitignore ├── js ├── help.js ├── about.js ├── forEachViewport.js ├── loadTemplate.js ├── disableAllTools.js ├── imageViewer.js ├── setupViewport.js ├── displayThumbnail.js ├── cornerstoneDemo.js ├── setupViewportOverlays.js ├── setupButtons.js └── loadStudy.js ├── lib ├── cornerstone.min.css ├── cornerstone.css ├── cornerstoneFileImageLoader.js ├── cornerstoneWebImageLoader.js ├── jquery-ui.min.css ├── hammer.min.js ├── bootstrap.min.js └── jquery-ui.min.js ├── studies ├── dermatology.json ├── crstudy.json ├── dxstudy.json ├── usdopplerstudy.json ├── usjpeg.json ├── ctstudy.json ├── mrstudy.json ├── ptctstudy.json └── mgstudy.json ├── package.json ├── templates ├── viewport.html ├── help.html ├── about.html └── studyViewer.html ├── bower.json ├── README.md ├── gruntfile.js ├── studyList.json ├── css └── cornerstoneDemo.css ├── architecture.html ├── studyViewer.html └── index.html /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | .idea -------------------------------------------------------------------------------- /js/help.js: -------------------------------------------------------------------------------- 1 | loadTemplate("templates/help.html", function(element) { 2 | $('body').append(element); 3 | $("#help").click(function() { 4 | $("#helpModal").modal(); 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /js/about.js: -------------------------------------------------------------------------------- 1 | loadTemplate("templates/about.html", function(element) { 2 | $('body').append(element); 3 | $("#about").click(function() { 4 | $("#aboutModal").modal(); 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /lib/cornerstone.min.css: -------------------------------------------------------------------------------- 1 | /*! cornerstone - v0.8.1 - 2015-06-16 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */.cornerstone-enabled-image{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default} -------------------------------------------------------------------------------- /js/forEachViewport.js: -------------------------------------------------------------------------------- 1 | function forEachViewport(callback) { 2 | var elements = $('.viewport'); 3 | $.each(elements, function(index, value) { 4 | var element = value; 5 | try { 6 | callback(element); 7 | } 8 | catch(e) { 9 | 10 | } 11 | }); 12 | } -------------------------------------------------------------------------------- /js/loadTemplate.js: -------------------------------------------------------------------------------- 1 | function loadTemplate(url, callback) { 2 | $.get(url, function(data) { 3 | var parsed = $.parseHTML(data); 4 | $.each(parsed, function(index, ele) { 5 | if(ele.nodeName === 'DIV') 6 | { 7 | var element = $(ele); 8 | callback(element); 9 | } 10 | }); 11 | }); 12 | 13 | } -------------------------------------------------------------------------------- /studies/dermatology.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "Dermatology", 3 | "patientId": "922746522", 4 | "studyDate": "20010109", 5 | "modality": "DERM", 6 | "studyDescription": "Skin Rash", 7 | "numImages": 2, 8 | "studyId": "dermatology", 9 | "seriesList": [{ 10 | "seriesDescription": "Back", 11 | "seriesNumber": "28858", 12 | "instanceList": [{ 13 | "imageId": "http://127.0.0.1/testDICOM/JPG/1.jpg" 14 | }] 15 | }] 16 | } -------------------------------------------------------------------------------- /studies/crstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "MISTER^CR", 3 | "patientId": "9227465", 4 | "studyDate": "20010109", 5 | "modality": "CR", 6 | "studyDescription": "pelvis", 7 | "numImages": 2, 8 | "studyId": "crstudy", 9 | "seriesList": [{ 10 | "seriesDescription": "Pelvis PA", 11 | "seriesNumber": "1", 12 | "instanceList": [{ 13 | "imageId": "1.5191KB.DCM" 14 | }] 15 | }, 16 | { 17 | "seriesDescription": "PELVIS LAT", 18 | "seriesNumber": "1", 19 | "instanceList": [{ 20 | "imageId": "2.516KB.DCM" 21 | }] 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /studies/dxstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "MISTER^CR", 3 | "patientId": "9227465", 4 | "studyDate": "20010109", 5 | "modality": "DX", 6 | "studyDescription": "CHEST", 7 | "numImages": 2, 8 | "studyId": "dxstudy", 9 | "seriesList": [{ 10 | "seriesDescription": "PA", 11 | "seriesNumber": "28858", 12 | "instanceList": [{ 13 | "imageId": "DXStudy/3.79KB.DCM" 14 | }] 15 | }, 16 | { 17 | "seriesDescription": "LAT", 18 | "seriesNumber": "28860", 19 | "instanceList": [{ 20 | "imageId": "DXStudy/2.516KB.DCM" 21 | }] 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /lib/cornerstone.css: -------------------------------------------------------------------------------- 1 | /*! cornerstone - v0.7.3 - 2015-04-04 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */ 2 | .cornerstone-enabled-image { 3 | 4 | /* prevent text selection from occurring when dragging the mouse on the div */ 5 | /* http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting */ 6 | -webkit-touch-callout: none; 7 | -webkit-user-select: none; 8 | -khtml-user-select: none; 9 | -moz-user-select: none; 10 | -ms-user-select: none; 11 | user-select: none; 12 | 13 | /* force the cursor to always be the default arrow. This prevents it from changing to an ibar when it is 14 | over HTML based text overlays (four corners */ 15 | cursor:default; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /studies/usdopplerstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "US Echo", 3 | "patientId": "", 4 | "studyDate": "20120418", 5 | "modality": "US", 6 | "studyDescription": "US Dopler", 7 | "numImages": 22, 8 | "studyId": "usdopplerstudy", 9 | "seriesList": [{ 10 | "seriesDescription": "Image #1", 11 | "seriesNumber": "1", 12 | "instanceList": [{ 13 | "imageId": "USDoppler/1.5191KB.DCM" 14 | }] 15 | }, 16 | { 17 | "seriesDescription": "Image #2", 18 | "seriesNumber": "2", 19 | "instanceList": [{ 20 | "imageId": "USDoppler/2.516KB.DCM" 21 | }] 22 | }, 23 | { 24 | "seriesDescription": "Image #3", 25 | "seriesNumber": "3", 26 | "instanceList": [{ 27 | "imageId": "USDoppler/3.79KB.DCM" 28 | }] 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /js/disableAllTools.js: -------------------------------------------------------------------------------- 1 | // Disable all tools 2 | function disableAllTools() { 3 | forEachViewport(function(element) { 4 | cornerstoneTools.wwwc.disable(element); 5 | cornerstoneTools.pan.activate(element, 2); // 2 is middle mouse button 6 | cornerstoneTools.zoom.activate(element, 4); // 4 is right mouse button 7 | cornerstoneTools.probe.deactivate(element, 1); 8 | cornerstoneTools.length.deactivate(element, 1); 9 | cornerstoneTools.angle.deactivate(element, 1); 10 | cornerstoneTools.ellipticalRoi.deactivate(element, 1); 11 | cornerstoneTools.rectangleRoi.deactivate(element, 1); 12 | cornerstoneTools.stackScroll.deactivate(element, 1); 13 | cornerstoneTools.wwwcTouchDrag.deactivate(element); 14 | cornerstoneTools.zoomTouchDrag.deactivate(element); 15 | cornerstoneTools.panTouchDrag.deactivate(element); 16 | cornerstoneTools.stackScrollTouchDrag.deactivate(element); 17 | }); 18 | } -------------------------------------------------------------------------------- /studies/usjpeg.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "US JPEG", 3 | "patientId": "123454321", 4 | "studyDate": "20120418", 5 | "modality": "US", 6 | "studyDescription": "US FETAL SURVEY", 7 | "numImages": 22, 8 | "studyId": "usjpeg", 9 | "seriesList": [{ 10 | "seriesDescription": "Image #1", 11 | "seriesNumber": "1", 12 | "instanceList": [{ 13 | "imageId": "GEOB/1.5191KB.DCM" 14 | }] 15 | }, 16 | { 17 | "seriesDescription": "Image #2", 18 | "seriesNumber": "2", 19 | "instanceList": [{ 20 | "imageId": "GEOB/2.516KB.DCM" 21 | }] 22 | }, 23 | { 24 | "seriesDescription": "Image #3 (clip)", 25 | "seriesNumber": "3", 26 | "numberOfFrames": 96, 27 | "frameRate": 31, 28 | "instanceList": [{ 29 | "imageId": "GEOB/3.79KB.DCM" 30 | }] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cornerstoneDemo", 3 | "version": "0.1.0", 4 | "description": "Cornerstone Demo", 5 | "keywords": [ 6 | "DICOM", 7 | "WADO", 8 | "cornerstone", 9 | "medical", 10 | "imaging" 11 | ], 12 | "author": "Chris Hafey", 13 | "homepage": "https://github.com/chafey/cornerstoneDemo", 14 | "licnense": "MIT", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/chafey/cornerstoneDemo.git" 18 | }, 19 | "scripts": { 20 | "test": "echo \"Error: no test specified\" && exit 1" 21 | }, 22 | "devDependencies": { 23 | "grunt-contrib-copy": "0.4.x", 24 | "grunt-contrib-qunit": "^0.4.0", 25 | "grunt-contrib-concat": "^0.3.0", 26 | "grunt-contrib-watch": "^0.6.1", 27 | "grunt-contrib-clean": "^0.5.0", 28 | "grunt-contrib-jshint": "^0.8.0", 29 | "grunt-contrib-uglify": "^0.4.0", 30 | "load-grunt-tasks": "^0.2.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/viewport.html: -------------------------------------------------------------------------------- 1 |
32 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cornerstoneDemo", 3 | "version": "0.1.0", 4 | "description": "Cornerstone Demo Application", 5 | "main": "", 6 | "ignore": [ 7 | "examples", 8 | "src", 9 | "test", 10 | "gruntfile.js", 11 | "package.json", 12 | "README.md", 13 | ".gitignore" 14 | ], 15 | "dependencies": { 16 | "cornerstone": "~0.8.1", 17 | "cornerstoneTools": "~0.7.2", 18 | "cornerstoneWADOImageLoader": "~0.7.0", 19 | "cornerstoneWebImageLoader": "~0.5.2", 20 | "cornerstoneMath": "~0.1.2", 21 | "image-jpeg2000": "~0.3.1", 22 | "bootstrap": "~3.3.4", 23 | "hammerjs": "~2.0.4", 24 | "jquery" : "~2.1.1" 25 | }, 26 | "devDependencies": { 27 | "qunit": "~1.14.0" 28 | }, 29 | "license": "MIT", 30 | "authors": [ 31 | "Chris Hafey" 32 | ], 33 | "homepage": "https://github.com/chafey/cornerstoneDemo", 34 | "keywords": [ 35 | "DICOM", 36 | "medical", 37 | "imaging", 38 | "WADO", 39 | "cornerstone" 40 | ], 41 | "repository": { 42 | "type": "git", 43 | "url": "https://github.com/chafey/cornerstoneDemo.git" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /templates/help.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/imageViewer.js: -------------------------------------------------------------------------------- 1 | ImageViewer = function(root, viewport) { 2 | var self = this; 3 | 4 | self.root = root; 5 | self.stacks = []; 6 | self.viewports = []; 7 | self.layout = '1x1'; 8 | self.viewportModel = viewport; 9 | 10 | self.setLayout = function(layout) { 11 | self.layout = layout; 12 | // TODO: create viewports 13 | var ab = self.getRowsCols(), a = ab[0], b = ab[1], numOfViewports = a * b, 14 | perWidth = 100 / b, perHeight = 100 / a; 15 | self.root.find('.imageViewer').html(''); 16 | var i = 0; 17 | self.viewports = []; 18 | while (i < numOfViewports) { 19 | var elem = self.viewportModel.clone().css({ 20 | width : perWidth + '%', height : perHeight + '%' 21 | }).appendTo(self.root.find('.imageViewer')); 22 | elem.find('.viewport').data('index', i).data('waiting', true); 23 | 24 | self.viewports.push(elem); 25 | i++; 26 | } 27 | } 28 | 29 | self.getRowsCols = function() { 30 | var s = self.layout.split(/x/); 31 | return [parseInt(s[0]), parseInt(s[1])]; 32 | } 33 | 34 | self.isSingle = function() { 35 | return self.layout == '1x1'; 36 | } 37 | 38 | self.getElement = function(item) { 39 | return self.viewports[item].find('.viewport')[0]; 40 | } 41 | 42 | self.forEachElement = function(cb) { 43 | self.viewports.forEach(function(vp, i){ 44 | cb.call(self, vp.find('.viewport')[0], vp, i); 45 | }); 46 | } 47 | } -------------------------------------------------------------------------------- /js/setupViewport.js: -------------------------------------------------------------------------------- 1 | function setupViewport(element, stack, image) { 2 | // Display the image on the viewer element 3 | cornerstone.displayImage(element, image); 4 | 5 | // If it's a movie (has frames), then play the clip 6 | if (stack.frameRate !== undefined) { 7 | cornerstone.playClip(element, stack.frameRate); 8 | } 9 | 10 | // Activate mouse clicks, mouse wheel and touch 11 | cornerstoneTools.mouseInput.enable(element); 12 | cornerstoneTools.mouseWheelInput.enable(element); 13 | cornerstoneTools.touchInput.enable(element); 14 | 15 | // Enable all tools we want to use with this element 16 | cornerstoneTools.wwwc.activate(element, 1); // ww/wc is the default tool for left mouse button 17 | cornerstoneTools.pan.activate(element, 2); // pan is the default tool for middle mouse button 18 | cornerstoneTools.zoom.activate(element, 4); // zoom is the default tool for right mouse button 19 | cornerstoneTools.probe.enable(element); 20 | cornerstoneTools.length.enable(element); 21 | cornerstoneTools.ellipticalRoi.enable(element); 22 | cornerstoneTools.rectangleRoi.enable(element); 23 | cornerstoneTools.wwwcTouchDrag.activate(element); 24 | cornerstoneTools.zoomTouchPinch.activate(element); 25 | 26 | // Stack tools 27 | cornerstoneTools.addStackStateManager(element, ['playClip']); 28 | cornerstoneTools.addToolState(element, 'stack', stack); 29 | cornerstoneTools.stackScrollWheel.activate(element); 30 | cornerstoneTools.stackPrefetch.enable(element); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /templates/about.html: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /studies/ctstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "MISTER^CT", 3 | "patientId": "2178309", 4 | "studyDate": "20010105", 5 | "modality": "CT", 6 | "studyDescription": "CHEST", 7 | "numImages": 111, 8 | "studyId": "ctstudy", 9 | "seriesList": [{ 10 | "seriesUid": "1.5191", 11 | "seriesDescription": "HELICAL CHEST", 12 | "seriesNumber": "2", 13 | "instanceList": [{ 14 | "imageId": "CTStudy/1.5191KB.DCM" 15 | }, 16 | { 17 | "imageId": "CTStudy/2.516KB.DCM" 18 | }, 19 | { 20 | "imageId": "CTStudy/3.79KB.DCM" 21 | }, 22 | { 23 | "imageId": "CTStudy/test.dcm" 24 | } 25 | ] 26 | }, 27 | { 28 | "seriesUid": "2.516", 29 | "seriesDescription": "SCOUT PA", 30 | "seriesNumber": "1", 31 | "instanceList": [{ 32 | "imageId": "CTStudy/2.516KB.DCM" 33 | }] 34 | }, 35 | { 36 | "seriesUid": "3.79", 37 | "seriesDescription": "SCOUT LAT", 38 | "seriesNumber": "1.1", 39 | "instanceList": [{ 40 | "imageId": "CTStudy/3.79KB.DCM" 41 | }] 42 | }, 43 | { 44 | "seriesUid": "5", 45 | "seriesDescription": "PATHOLOGY", 46 | "seriesNumber": "5", 47 | "instanceList": [{ 48 | "imageId": "http://127.0.0.1/testDICOM/JPG/1.jpg" 49 | }] 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /js/displayThumbnail.js: -------------------------------------------------------------------------------- 1 | function displayThumbnail(seriesList, seriesElement, element, stack, loaded) { 2 | // Deactivate other thumbnails 3 | $(seriesList).find('a').each(function() { 4 | $(this).removeClass('active'); 5 | }); 6 | 7 | // Make this series visible 8 | 9 | // Make the selected thumbnail active 10 | $(seriesElement).addClass('active'); 11 | 12 | var enabledImage = cornerstone.getEnabledElement(element); 13 | if (enabledImage.image) { 14 | // Stop clip from if playing on element 15 | cornerstoneTools.stopClip(element); 16 | // Disable stack scrolling 17 | cornerstoneTools.stackScroll.disable(element); 18 | // Enable stackScroll on selected series 19 | cornerstoneTools.stackScroll.enable(element); 20 | } 21 | 22 | // Load the first image of the selected series stack 23 | cornerstone.loadAndCacheImage(stack.imageIds[0]).then(function(image) { 24 | if (loaded) { 25 | loaded.call(image, element, stack); 26 | } 27 | 28 | // Get the state of the stack tool 29 | var stackState = cornerstoneTools.getToolState(element, 'stack'); 30 | stackState.data[0] = stack; 31 | stackState.data[0].currentImageIdIndex = 0; 32 | 33 | // Get the default viewport 34 | var defViewport = cornerstone.getDefaultViewport(element, image); 35 | // Get the current series stack index 36 | // Display the image 37 | cornerstone.displayImage(element, image, defViewport); 38 | // Fit the image to the viewport window 39 | cornerstone.fitToWindow(element); 40 | 41 | // Prefetch the remaining images in the stack (?) 42 | cornerstoneTools.stackPrefetch.enable(element); 43 | 44 | // Play clip if stack is a movie (has framerate) 45 | if (stack.frameRate !== undefined) { 46 | cornerstoneTools.playClip(element, stack.frameRate); 47 | } 48 | }); 49 | }; -------------------------------------------------------------------------------- /studies/mrstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "MISTER^MR", 3 | "patientId": "832040", 4 | "studyDate": "20010108", 5 | "modality": "MR", 6 | "studyDescription": "BRAIN SELLA", 7 | "numImages": 17, 8 | "studyId": "mrstudy", 9 | "seriesList": [{ 10 | "seriesDescription": "3-PLANE LOC", 11 | "seriesNumber": "1", 12 | "instanceList": [{ 13 | "imageId": "MRStudy/MR000000.dcm" 14 | }, 15 | { 16 | "imageId": "MRStudy/MR000001.dcm" 17 | }, 18 | { 19 | "imageId": "MRStudy/MR000002.dcm" 20 | }, 21 | { 22 | "imageId": "MRStudy/MR000003.dcm" 23 | }, 24 | { 25 | "imageId": "MRStudy/MR000003.dcm" 26 | }, 27 | { 28 | "imageId": "MRStudy/MR000004.dcm" 29 | }, 30 | { 31 | "imageId": "MRStudy/MR000005.dcm" 32 | }, 33 | { 34 | "imageId": "MRStudy/MR000006.dcm" 35 | }, 36 | { 37 | "imageId": "MRStudy/MR000007.dcm" 38 | }, 39 | { 40 | "imageId": "MRStudy/MR000008.dcm" 41 | } 42 | ] 43 | }, 44 | { 45 | "seriesDescription": "SAG T-1", 46 | "seriesNumber": "2", 47 | "instanceList": [{ 48 | "imageId": "MRStudy/MR000009.dcm" 49 | }, 50 | { 51 | "imageId": "MRStudy/MR000010.dcm" 52 | }, 53 | { 54 | "imageId": "MRStudy/MR000011.dcm" 55 | }, 56 | { 57 | "imageId": "MRStudy/MR000012.dcm" 58 | } 59 | ] 60 | } 61 | ] 62 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Interactive Medical Images 2 | ================ 3 | 4 | 何使用各种基础组件来构建一个完整的应用程序 5 | 6 | 当前显示一个研究列表,并在选定的系列缩略图和各种工具中显示它们。 7 | 基础模块的使用: 8 | 9 | - [Cornerstone (core)](https://github.com/chafey/cornerstone) 10 | - [Cornerstone Tools](https://github.com/chafey/cornerstoneTools) 11 | - [Cornerstone Math](https://github.com/chafey/cornerstoneMath) 12 | - [Cornerstone WADO image loader](https://github.com/chafey/cornerstoneWADOImageLoader) 13 | - [Cornerstone Web image loader](https://github.com/chafey/cornerstoneWebImageLoader) 14 | 15 | 16 | 安装 17 | ================ 18 | 19 | - 克隆 这个应用程序 并切换到它的目录 20 | 21 | - 安装依赖 [Bower](http://bower.io/): 22 | 23 | > 运行 24 | 25 | 使用方法: 26 | ================ 27 | * 这个程序需要 http 开头的路径才能正常运行,所以需要搭建一个运行环境 28 | 1. 安装 XAMPP 克隆这个项目放到 XAMPP 安装目录下的 htdcos 目录下 启动 Apache Web服务器 29 | 30 | * 了解这个程序的运行原理 31 | 1. 在浏览器中输入 http://127.0.0.1/InteractiveMedicalImages/architecture.html 查看程序运行相关依赖 和 原理 32 | 33 | * 下面开始运行这个程序 34 | 1. 在浏览器中输入 http://127.0.0.1/InteractiveMedicalImages/ [此时会看到一个黑色的界面] 35 | 2. 打控制台看是否有报错 ( 有的话 运行环境的问题 调整运行环境) 36 | 37 | * 将这个程序融入到 自己的项目中 38 | 1. index.html : 这是项目的整体UI界面 其他 UI 都是通过动态插入html模板进行加载的, 在文最底部 是 入口 js 看懂了这段 js 代码 项目基本已经 融入50%了 39 | 2. disableAllTools.js 和 displayThumbnail.js 是显示隐藏工具的 其他的文件自己看文件名就能懂了 40 | 3. 重点在 loadStudy.js 这个是负责加载数据的 搜索 dicomweb://10.0.0.5/testDICOM/ 将他修改成 你自己的文地址 比如: dicomweb://127.0.0.1/testDICOM/ 就ok了 注意这里有坑 dicomweb 不可以修改这个前缀可以自动识别 协议名 http ,https ...千万不能改 41 | 4. 注意看 studies 文件夹 json 数据是与 loadstudy.js 中的 ImageId 像对应的 所以需要配置对应路径的文件夹以及文件 都准备好了 [点击下载](https://github.com/bianliuzhu/testDicom) 将这个文件加压后 修改文件名为 testDICOM 并把这个文件夹 copy 到 htdocs 目录下 42 | 5. 现在项目可以跑起来了 43 | 6. 如有错误请指正 [Email:bianliuzhu@gmail.com] 44 | 45 | 46 | 疑问: 47 | ================ 48 | 49 | 2018年9月5日 网友 [葉子紛飛](75797351@qq.com) 给我发来邮件,遇到两个问题: 50 | 51 | 问题描述: 52 | 53 | 1.部分标准影像无法展示 54 | [葉子紛飛](75797351@qq.com)已经提供解决方案: 55 | 只需要修改原来项目的InteractiveMedicalImages\lib\dicomParser.js文件即可, 56 | 57 | 可以从[DicomParsing](https://github.com/GleasonBian/DicomParsing)项目内提取到dicomParser.js文件。 58 | 59 | 2.非标准Dicom影像无法显示 60 | 目前该问题 尚未 解决 61 | 62 | 感谢: 63 | ================ 64 | 非常感谢 @[葉子紛飛](75797351@qq.com) 的 提醒 邮件地址已更正 -------------------------------------------------------------------------------- /gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json'), 6 | clean: { 7 | default: { 8 | src: [ 9 | 'dist', 10 | 'docs', 11 | 'build' 12 | ] 13 | } 14 | }, 15 | copy: { 16 | bower: { 17 | src: [ 18 | 'bower_components/cornerstone/dist/cornerstone.min.css', 19 | 'bower_components/cornerstone/dist/cornerstone.js', 20 | 'bower_components/cornerstoneTools/dist/cornerstoneTools.js', 21 | 'bower_components/cornerstoneWADOImageLoader/dist/cornerstoneWADOImageLoader.js', 22 | 'bower_components/cornerstoneWebImageLoader/dist/cornerstoneWebImageLoader.js', 23 | 'bower_components/cornerstoneMath/dist/cornerstoneMath.js', 24 | 'bower_components/cornerstone-file-image-loader/dist/cornerstoneFileImageLoader.js', 25 | 'bower_components/image-jpeg2000/dist/jpx.js', 26 | 'bower_components/dicomParser/dist/dicomParser.js', 27 | 'bower_components/bootstrap/dist/js/bootstrap.min.js', 28 | 'bower_components/hammerjs/hammer.min.js', 29 | 'bower_components/jquery/dist/jquery.js', 30 | 'bower_components/jquery/dist/jquery.min.js', 31 | 'bower_components/jquery/dist/jquery.min.map', 32 | 'bower_components/bootstrap/dist/css/bootstrap.min.css' 33 | ], 34 | dest: 'lib', 35 | expand: true, 36 | flatten: true 37 | } 38 | 39 | } 40 | }); 41 | 42 | require('load-grunt-tasks')(grunt); 43 | 44 | grunt.registerTask('buildAll', ['clean']); 45 | grunt.registerTask('default', ['buildAll']); 46 | }; 47 | 48 | //发布流程: 49 | 50 | // 1)更新版本号 51 | 52 | // 2)进行构建(需要用正确的构建号更新分区版本) 53 | 54 | // 3)提交修改 55 | 56 | // git提交是“改变....” 57 | 58 | // 4)标记提交 59 | 60 | // git标签- 0.1.0 -m“版本0.1.0” 61 | 62 | // 5)推到github 63 | 64 | // git推源主标签 -------------------------------------------------------------------------------- /studies/ptctstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "Patient^Anonymous", 3 | "patientId": "12345678", 4 | "studyDate": "20100510", 5 | "modality": "PTCT", 6 | "studyDescription": "Neck^HeadNeckPETCT", 7 | "numImages": 261, 8 | "studyId": "ptctstudy", 9 | "seriesList": [{ 10 | "seriesUid": "1.3.6.1.4.1.25403.52237031786.3872.20100510032220.2", 11 | "seriesDescription": "CT HeadNeck 5.0 H30s", 12 | "seriesNumber": "2", 13 | "instanceList": [{ 14 | "imageId": "PTCTStudy/1.5191KB.DCM" 15 | }, 16 | { 17 | "imageId": "PTCTStudy/2.516KB.DCM" 18 | }, 19 | { 20 | "imageId": "PTCTStudy/3.79KB.DCM" 21 | }, 22 | { 23 | "imageId": "PTCTStudy/test.dcm" 24 | } 25 | ] 26 | }, 27 | { 28 | "seriesUid": "1.3.6.1.4.1.25403.52237031786.3872.20100510032225.14", 29 | "seriesDescription": "PET WB-uncorrected", 30 | "seriesNumber": "605", 31 | "instanceList": [{ 32 | "imageId": "PTCTStudy/1.5191KB.DCM" 33 | }, 34 | { 35 | "imageId": "PTCTStudy/2.516KB.DCM" 36 | }, 37 | { 38 | "imageId": "PTCTStudy/3.79KB.DCM" 39 | }, 40 | { 41 | "imageId": "PTCTStudy/test.dcm" 42 | } 43 | ] 44 | }, 45 | { 46 | 47 | "seriesUid": "1.3.6.1.4.1.25403.52237031786.3872.20100510032227.20", 48 | "seriesDescription": "PET WB", 49 | "seriesNumber": "606", 50 | "instanceList": [{ 51 | "imageId": "PTCTStudy/1.5191KB.DCM" 52 | }, 53 | { 54 | "imageId": "PTCTStudy/2.516KB.DCM" 55 | }, 56 | { 57 | "imageId": "PTCTStudy/3.79KB.DCM" 58 | }, 59 | { 60 | "imageId": "PTCTStudy/test.dcm" 61 | } 62 | ] 63 | } 64 | ] 65 | } -------------------------------------------------------------------------------- /studies/mgstudy.json: -------------------------------------------------------------------------------- 1 | { 2 | "patientName": "MS^MG", 3 | "patientId": "1346269", 4 | "studyDate": "20010109", 5 | "modality": "MG", 6 | "studyDescription": "MAMMOGRAM", 7 | "numImages": 8, 8 | "studyId": "mgstudy", 9 | "seriesList": [{ 10 | "seriesDescription": "MAMMOGRAM", 11 | "seriesNumber": "700", 12 | "instanceList": [{ 13 | "imageId": "MGStudy/1.5191KB.DCM" 14 | }] 15 | }, 16 | { 17 | "seriesDescription": "MAMMOGRAM", 18 | "seriesNumber": "700", 19 | "instanceList": [{ 20 | "imageId": "MGStudy/2.516KB.DCM" 21 | }] 22 | }, 23 | { 24 | "seriesDescription": "MAMMOGRAM", 25 | "seriesNumber": "700", 26 | "instanceList": [{ 27 | "imageId": "MGStudy/3.79KB.DCM" 28 | }] 29 | }, 30 | { 31 | "seriesDescription": "MAMMOGRAM", 32 | "seriesNumber": "700", 33 | "instanceList": [{ 34 | "imageId": "MGStudy/3.79KB.DCM" 35 | }] 36 | }, 37 | { 38 | "seriesDescription": "BILATERAL", 39 | "seriesNumber": "699", 40 | "instanceList": [{ 41 | "imageId": "MGStudy/3.79KB.DCM" 42 | }] 43 | }, 44 | { 45 | "seriesDescription": "BILATERAL", 46 | "seriesNumber": "699", 47 | "instanceList": [{ 48 | "imageId": "MGStudy/1.5191KB.DCM" 49 | }] 50 | }, 51 | { 52 | "seriesDescription": "BILATERAL", 53 | "seriesNumber": "699", 54 | "instanceList": [{ 55 | "imageId": "MGStudy/1.5191KB.DCM" 56 | }] 57 | }, 58 | { 59 | "seriesDescription": "BILATERAL", 60 | "seriesNumber": "699", 61 | "instanceList": [{ 62 | "imageId": "MGStudy/1.5191KB.DCM" 63 | }] 64 | }, 65 | { 66 | "seriesDescription": "BILATERAL", 67 | "seriesNumber": "699", 68 | "instanceList": [{ 69 | "imageId": "MGStudy/test.dcm" 70 | }] 71 | } 72 | ] 73 | } -------------------------------------------------------------------------------- /js/cornerstoneDemo.js: -------------------------------------------------------------------------------- 1 | // 负载在HTML模板 2 | 3 | var viewportTemplate; // 视图模板 4 | loadTemplate("templates/viewport.html", function (element) { 5 | console.log(element); 6 | viewportTemplate = element; 7 | }); 8 | 9 | var studyViewerTemplate; // the study 视图模板 10 | loadTemplate("templates/studyViewer.html", function (element) { 11 | studyViewerTemplate = element; 12 | }); 13 | 14 | // 从JSON清单中获取study列表 15 | $.getJSON('studyList.json', function (data) { 16 | data.studyList.forEach(function (study) { 17 | 18 | // 为清单中的每个 study 研究创建一个表行 19 | var studyRow = '16 | This page describes the architecture of the Cornerstone Demo application 17 |
18 |