Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring servers configuration structure #14

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 3 additions & 35 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down Expand Up @@ -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
}
1 change: 1 addition & 0 deletions LesionTracker/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ gilbertwat:bootstrap3-daterangepicker
email
peppelg:bootstrap-3-modal
simple:reactive-method
hangingprotocols
2 changes: 2 additions & 0 deletions LesionTracker/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ momentjs:[email protected]
[email protected]
[email protected]
mrt:[email protected]
natestrauser:[email protected]
[email protected]_2
[email protected]_1
[email protected]
[email protected]
[email protected]
peppelg:[email protected]
practicalmeteor:[email protected]_1
practicalmeteor:[email protected]_2
Expand Down
3 changes: 2 additions & 1 deletion LesionTracker/client/components/viewerMain/viewerMain.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template name="viewerMain">
<div class="viewerMain">
{{ >toolbar toolbarOptions=toolbarOptions }}
{{ >imageViewerViewports }}
<div id='layoutManagerTarget'>
</div>
</div>
</template>
19 changes: 13 additions & 6 deletions LesionTracker/client/components/viewerMain/viewerMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};

Expand All @@ -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);
});
9 changes: 8 additions & 1 deletion LesionTracker/client/components/viewerMain/viewerMain.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
font-weight: bold
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
183 changes: 183 additions & 0 deletions LesionTracker/client/lesionTrackerHangingProtocol.js
Original file line number Diff line number Diff line change
@@ -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);
});
3 changes: 1 addition & 2 deletions LesionTracker/client/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Object.keys(ViewerData).forEach(function(contentId) {

Router.configure({
layoutTemplate: 'lesionTrackerLayout',
loadingTemplate: 'lesionTrackerLayout',
notFoundTemplate: 'notFound'
loadingTemplate: 'lesionTrackerLayout'
});

Router.onBeforeAction('loading');
Expand Down
25 changes: 15 additions & 10 deletions LesionTracker/defaultSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Meteor.startup(function() {
}

Meteor.settings = {
dicomWeb: {
endpoints: [{
servers: {
dicomWeb: [{
name: 'Orthanc',
wadoUriRootNOTE: 'either this uri is not correct for wado-uri or wado-uri is not configured on orthanc currently',
wadoUriRoot: 'http://localhost:8043/wado',
Expand All @@ -21,17 +21,23 @@ Meteor.startup(function() {
logResponses: false,
logTiming: true
}
}],
dimse: [{
name: "ORTHANC_DIMSE",
peers: [{
host: 'localhost',
port: 4242,
aeTitle: 'ORTHANC',
default: true
}]
}]
},
dimse: [{
host: 'localhost',
port: 4242,
aeTitle: 'ORTHANC',
default: true
}],
"defaultServiceType": 'dicomWeb',
"public": {
"verifyEmail": false
"verifyEmail": false,
"ui": {
"studyListFunctionsEnabled": true
}
}
//defaultServiceType: 'dimse'
};
Expand All @@ -44,4 +50,3 @@ Meteor.startup(function() {
// return 'If you leave this page then any unsaved changes will be lost.';
});
});

Loading