diff --git a/.jshintrc b/.jshintrc index 2f7a6233b..607e68961 100644 --- a/.jshintrc +++ b/.jshintrc @@ -43,7 +43,7 @@ "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. "eqnull" : false, // true: Tolerate use of `== null` "es5" : true, // true: Allow ES5 syntax (ex: getters and setters) - "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) + "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`) "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) // (ex: `for each`, multiple try/catch, function expression…) "evil" : false, // true: Tolerate use of `eval` and `new Function()` @@ -85,37 +85,5 @@ "typed" : false, // Globals for typed array constructions "worker" : false, // Web Workers "wsh" : false, // Windows Scripting Host - "yui" : false, // Yahoo User Interface - - // Custom Globals - // additional predefined global variables - "globals" : { - console: true, - prompt: true, - $: true, - Hammer: true, - cornerstone: true, - cornerstoneMath: true, - cornerstoneTools: true, - cornerstoneTools: true, - - // Meteor-specific Globals - Meteor: true, - Template: true, - UI: true, - Session: true, - - // loglevel package - log: true, - - // OHIF-package specific Globals - OHIF: true, - toolManager: true, - ViewerData: true, - ViewerStudies: true, - LesionManager: true, - Timepoints: true, - Measurements: true, - StudyImportStatus: true - } + "yui" : false // Yahoo User Interface } \ No newline at end of file diff --git a/LesionTracker/.meteor/packages b/LesionTracker/.meteor/packages index a17d120ed..2933bff58 100644 --- a/LesionTracker/.meteor/packages +++ b/LesionTracker/.meteor/packages @@ -54,3 +54,4 @@ gilbertwat:bootstrap3-daterangepicker email peppelg:bootstrap-3-modal simple:reactive-method +hangingprotocols diff --git a/LesionTracker/.meteor/versions b/LesionTracker/.meteor/versions index 37f81bc2d..bef0a4d81 100644 --- a/LesionTracker/.meteor/versions +++ b/LesionTracker/.meteor/versions @@ -31,6 +31,7 @@ clinical:router-url@2.0.15 clinical:theming@0.4.10 coffeescript@1.0.11 cornerstone@0.0.1 +dburles:mongo-collection-instances@0.3.4 ddp@1.2.2 ddp-client@1.2.1 ddp-common@1.2.2 @@ -63,6 +64,7 @@ iron:core@1.0.11 iron:dynamic-template@1.0.12 iron:layout@1.0.12 jquery@1.11.4 +lai:collection-extensions@0.1.4 launch-screen@1.0.4 lesiontracker@0.0.1 livedata@1.0.15 @@ -79,10 +81,12 @@ momentjs:moment@2.12.0 mongo@1.1.3 mongo-id@1.0.1 mrt:moment@2.8.1 +natestrauser:select2@4.0.2 npm-bcrypt@0.7.8_2 npm-mongo@1.4.39_1 observe-sequence@1.0.7 ordered-dict@1.0.4 +orthanc-remote@0.0.1 peppelg:bootstrap-3-modal@1.0.4 practicalmeteor:chai@2.1.0_1 practicalmeteor:loglevel@1.2.0_2 @@ -94,6 +98,7 @@ reactive-var@1.0.6 reload@1.1.4 retry@1.0.4 routepolicy@1.0.6 +rubaxa:sortable@1.3.0 rwatts:uuid@0.0.2 service-configuration@1.0.5 session@1.1.1 diff --git a/LesionTracker/client/components/viewerMain/viewerMain.html b/LesionTracker/client/components/viewerMain/viewerMain.html index 6bf8bf680..dd8f44d2d 100644 --- a/LesionTracker/client/components/viewerMain/viewerMain.html +++ b/LesionTracker/client/components/viewerMain/viewerMain.html @@ -1,6 +1,7 @@ \ No newline at end of file diff --git a/LesionTracker/client/components/viewerMain/viewerMain.js b/LesionTracker/client/components/viewerMain/viewerMain.js index 7ec7e0902..6eec6e550 100644 --- a/LesionTracker/client/components/viewerMain/viewerMain.js +++ b/LesionTracker/client/components/viewerMain/viewerMain.js @@ -86,25 +86,23 @@ Template.viewerMain.helpers({ // CR/UN/EX Tools var crunexToolsBtns = { id: 'crunexTools', - tools:[{ + tools: [{ id: 'crTool', title: 'CR Tool', classes: 'imageViewerTool', iconClasses: 'fa fa-cr' - }, - { + }, { id: 'unTool', title: 'UN Tool', classes: 'imageViewerTool', iconClasses: 'fa fa-un' - }, - { + }, { id: 'exTool', title: 'EX Tool', classes: 'imageViewerTool', iconClasses: 'fa fa-ex' }], - title: "CR/UN/EX", + title: 'CR/UN/EX', groupIcon: 'fa fa-exchange' }; @@ -118,3 +116,12 @@ Template.viewerMain.helpers({ return toolbarOptions; } }); + +Template.viewerMain.onRendered(function() { + var parentNode = document.getElementById('layoutManagerTarget'); + var studies = this.data.studies; + layoutManager = new LayoutManager(parentNode, studies); + + ProtocolEngine = new HP.ProtocolEngine(layoutManager, studies); + HP.setEngine(ProtocolEngine); +}); diff --git a/LesionTracker/client/components/viewerMain/viewerMain.styl b/LesionTracker/client/components/viewerMain/viewerMain.styl index fcd7b0cff..f29c98428 100644 --- a/LesionTracker/client/components/viewerMain/viewerMain.styl +++ b/LesionTracker/client/components/viewerMain/viewerMain.styl @@ -2,15 +2,22 @@ width: 100% height: 84% + #layoutManagerTarget + width: 100% + height: calc(100% - 30px) + //font awesome icons .fa-cr:before content: 'CR' font-weight: bold + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif .fa-un:before content: 'UN' font-weight: bold + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif .fa-ex:before content: 'EX' - font-weight: bold \ No newline at end of file + font-weight: bold + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif \ No newline at end of file diff --git a/LesionTracker/client/lesionTrackerHangingProtocol.js b/LesionTracker/client/lesionTrackerHangingProtocol.js new file mode 100644 index 000000000..d0b7a836a --- /dev/null +++ b/LesionTracker/client/lesionTrackerHangingProtocol.js @@ -0,0 +1,183 @@ +// Define Baseline protocol +var proto = new HP.Protocol('LT_Baseline'); +proto.locked = true; + +var studyDescription = new HP.ProtocolMatchingRule(); +studyDescription.required = true; +studyDescription.attribute = 'studyDescription'; +studyDescription.constraint = { + contains: { + value: 'CT' + } +}; + +var isBaseline = new HP.ProtocolMatchingRule(); +isBaseline.required = true; +isBaseline.attribute = 'timepointType'; +isBaseline.constraint = { + equals: { + value: 'baseline' + } +}; + +proto.addProtocolMatchingRule(studyDescription); +proto.addProtocolMatchingRule(isBaseline); + +var oneByOne = new HP.ViewportStructure('grid', { + rows: 1, + columns: 1 +}); + +// Stage 1 +var single = new HP.Viewport(); + +var baseline = new HP.StudyMatchingRule(true); +baseline.required = true; +baseline.attribute = 'timepointType'; +baseline.constraint = { + equals: { + value: 'baseline' + } +}; + +var body = new HP.SeriesMatchingRule(); +body.attribute = 'seriesDescription'; +body.weight = 5; +body.constraint = { + contains: { + value: 'Body' + } +}; + +var chest = new HP.SeriesMatchingRule(); +chest.attribute = 'seriesDescription'; +chest.constraint = { + contains: { + value: 'CHEST' + } +}; + +single.studyMatchingRules.push(baseline); +single.seriesMatchingRules.push(body); +single.seriesMatchingRules.push(chest); + +var first = new HP.Stage(oneByOne, 'oneByOne'); +first.viewports.push(single); + +proto.addStage(first); + +HP.lesionTrackerBaselineProtocol = proto; +HP.lesionTrackerBaselineProtocol.id = 'lesionTrackerBaselineProtocol'; + + +// Define Followup Protocol +var proto = new HP.Protocol('LT_BaselineFollowup'); +proto.locked = true; + +var studyDescription = new HP.ProtocolMatchingRule(); +studyDescription.required = true; +studyDescription.attribute = 'studyDescription'; +studyDescription.constraint = { + contains: { + value: 'CT' + } +}; + +var isFollowup = new HP.ProtocolMatchingRule(); +isFollowup.required = true; +isFollowup.attribute = 'timepointType'; +isFollowup.constraint = { + equals: { + value: 'followup' + } +}; + +proto.addProtocolMatchingRule(studyDescription); +proto.addProtocolMatchingRule(isFollowup); + +var oneByTwo = new HP.ViewportStructure('grid', { + rows: 1, + columns: 2 +}); + +// Stage 1 +var left = new HP.Viewport(); +var right = new HP.Viewport(); + +var baseline = new HP.StudyMatchingRule(true); +baseline.required = true; +baseline.attribute = 'timepointType'; +baseline.constraint = { + equals: { + value: 'baseline' + } +}; + +var followup = new HP.StudyMatchingRule(); +followup.required = true; +followup.attribute = 'timepointType'; +followup.constraint = { + equals: { + value: 'followup' + } +}; + +var body = new HP.SeriesMatchingRule(); +body.attribute = 'seriesDescription'; +body.weight = 5; +body.constraint = { + contains: { + value: 'Body' + } +}; + +var chest = new HP.SeriesMatchingRule(); +chest.attribute = 'seriesDescription'; +chest.constraint = { + contains: { + value: 'CHEST' + } +}; + +left.studyMatchingRules.push(baseline); +left.seriesMatchingRules.push(body); +left.seriesMatchingRules.push(chest); + +right.studyMatchingRules.push(followup); +right.seriesMatchingRules.push(body); +right.seriesMatchingRules.push(chest); + +var first = new HP.Stage(oneByTwo, 'oneByTwo'); +first.viewports.push(left); +first.viewports.push(right); + +proto.addStage(first); + +HP.lesionTrackerFollowupProtocol = proto; +HP.lesionTrackerFollowupProtocol.id = 'lesionTrackerFollowupProtocol'; + +Meteor.call('removeHangingProtocolByID', HP.lesionTrackerBaselineProtocol.id, function() { + HangingProtocols.insert(HP.lesionTrackerBaselineProtocol); +}); + +Meteor.call('removeHangingProtocolByID', HP.lesionTrackerFollowupProtocol.id, function() { + HangingProtocols.insert(HP.lesionTrackerFollowupProtocol); +}); + +Meteor.startup(function() { + getTimepointType = function(study) { + var timepoint = Timepoints.findOne({ + studyInstanceUids: { + $in: [study.studyInstanceUid] + } + }); + + if (!timepoint) { + return; + } + + return timepoint.timepointType; + }; + + HP.addCustomAttribute('timepointType', 'Timepoint Type', getTimepointType); +}); \ No newline at end of file diff --git a/LesionTracker/client/routes.js b/LesionTracker/client/routes.js index a13ff0bb4..3673788e2 100644 --- a/LesionTracker/client/routes.js +++ b/LesionTracker/client/routes.js @@ -15,8 +15,7 @@ Object.keys(ViewerData).forEach(function(contentId) { Router.configure({ layoutTemplate: 'lesionTrackerLayout', - loadingTemplate: 'lesionTrackerLayout', - notFoundTemplate: 'notFound' + loadingTemplate: 'lesionTrackerLayout' }); Router.onBeforeAction('loading'); diff --git a/OHIFViewer/.meteor/packages b/OHIFViewer/.meteor/packages index 7c7606aa1..c0d1eb642 100644 --- a/OHIFViewer/.meteor/packages +++ b/OHIFViewer/.meteor/packages @@ -4,9 +4,6 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -accounts-password -ian:accounts-ui-bootstrap-3 -iron:router twbs:bootstrap http arsnebula:reactive-promise @@ -37,3 +34,4 @@ practicalmeteor:loglevel hangingprotocols reactive-dict gilbertwat:bootstrap3-daterangepicker +clinical:router \ No newline at end of file diff --git a/OHIFViewer/.meteor/versions b/OHIFViewer/.meteor/versions index b0cc224fc..013be8bed 100644 --- a/OHIFViewer/.meteor/versions +++ b/OHIFViewer/.meteor/versions @@ -1,6 +1,3 @@ -accounts-base@1.2.2 -accounts-password@1.1.4 -anti:i18n@0.4.3 arsnebula:reactive-promise@0.9.1 autoupdate@1.2.4 babel-compiler@5.8.24_1 @@ -15,12 +12,15 @@ caching-compiler@1.0.0 caching-html-compiler@1.0.2 callback-hook@1.0.4 check@1.1.0 +clinical:router@2.0.17 +clinical:router-location@2.0.14 +clinical:router-middleware-stack@2.0.13 +clinical:router-url@2.0.15 coffeescript@1.0.11 cornerstone@0.0.1 ddp@1.2.2 ddp-client@1.2.1 ddp-common@1.2.2 -ddp-rate-limiter@1.0.0 ddp-server@1.2.2 deps@1.0.9 dicomweb@0.0.1 @@ -29,7 +29,6 @@ dimseservice@0.0.1 ecmascript@0.1.6 ecmascript-runtime@0.2.6 ejson@1.0.7 -email@1.0.8 fastclick@1.0.7 fortawesome:fontawesome@4.4.0 geojson-utils@1.0.4 @@ -39,20 +38,14 @@ hot-code-push@1.0.0 html-tools@1.0.5 htmljs@1.0.5 http@1.1.1 -ian:accounts-ui-bootstrap-3@1.2.83 id-map@1.0.4 iron:controller@1.0.12 iron:core@1.0.11 iron:dynamic-template@1.0.12 iron:layout@1.0.12 -iron:location@1.0.11 -iron:middleware-stack@1.0.11 -iron:router@1.0.12 -iron:url@1.0.11 jquery@1.11.4 launch-screen@1.0.4 livedata@1.0.15 -localstorage@1.0.5 logging@1.0.8 meteor@1.1.10 meteor-base@1.0.1 @@ -65,28 +58,25 @@ momentjs:moment@2.9.0 mongo@1.1.3 mongo-id@1.0.1 mrt:moment@2.8.1 -npm-bcrypt@0.7.8_2 +natestrauser:select2@4.0.1 npm-mongo@1.4.39_1 observe-sequence@1.0.7 ordered-dict@1.0.4 +orthanc-remote@0.0.1 practicalmeteor:chai@1.9.2_3 practicalmeteor:loglevel@1.1.0_3 promise@0.5.1 random@1.0.5 -rate-limit@1.0.0 reactive-dict@1.1.3 reactive-var@1.0.6 reload@1.1.4 retry@1.0.4 routepolicy@1.0.6 rwatts:uuid@0.0.2 -service-configuration@1.0.5 session@1.1.1 -sha@1.0.4 silentcicero:jszip@0.0.4 spacebars@1.0.7 spacebars-compiler@1.0.7 -srp@1.0.4 standard-app-packages@1.0.6 standard-minifiers@1.0.2 stylus@2.511.1 diff --git a/Packages/viewerbase/client/components/basic/layout/layout.html b/OHIFViewer/client/components/layout/layout.html similarity index 79% rename from Packages/viewerbase/client/components/basic/layout/layout.html rename to OHIFViewer/client/components/layout/layout.html index fc3a7c5e3..dda5b3fa5 100644 --- a/Packages/viewerbase/client/components/basic/layout/layout.html +++ b/OHIFViewer/client/components/layout/layout.html @@ -18,13 +18,6 @@
  • About
  • -
  • - -
  • diff --git a/Packages/viewerbase/client/components/basic/layout/layout.styl b/OHIFViewer/client/components/layout/layout.styl similarity index 88% rename from Packages/viewerbase/client/components/basic/layout/layout.styl rename to OHIFViewer/client/components/layout/layout.styl index 7fb905e2b..e3d233b3a 100644 --- a/Packages/viewerbase/client/components/basic/layout/layout.styl +++ b/OHIFViewer/client/components/layout/layout.styl @@ -9,11 +9,14 @@ .navbar margin-bottom: 0 border-radius: 0 - color: #888888 background-color: #060606 border: none font-family: "Sanchez" color: #C1C1C1 + + -webkit-transition: all 0.3s ease + -moz-transition: all 0.3s ease + transition: all 0.3s ease .navbar-default .navbar-nav > li > a color: #C1C1C1 diff --git a/OHIFViewer/client/components/viewer/viewer.html b/OHIFViewer/client/components/viewer/viewer.html index eabbfd0de..c731ecae5 100644 --- a/OHIFViewer/client/components/viewer/viewer.html +++ b/OHIFViewer/client/components/viewer/viewer.html @@ -1,13 +1,18 @@