From 139df1685e77aed1f7a243e68b09dad8e54126ce Mon Sep 17 00:00:00 2001 From: akeshavan Date: Fri, 23 Jun 2017 12:08:39 -0700 Subject: [PATCH 1/6] enh: removing python generation part --- imports/api/module_tables.js | 134 ++++++++++++---------- imports/ui/module_templates.html | 124 +++++---------------- imports/ui/module_templates.js | 183 +++++++++---------------------- 3 files changed, 160 insertions(+), 281 deletions(-) diff --git a/imports/api/module_tables.js b/imports/api/module_tables.js index 26be6a2..ffa4d61 100644 --- a/imports/api/module_tables.js +++ b/imports/api/module_tables.js @@ -10,34 +10,58 @@ import "./methods.js" TabularTables = {} +console.log("Meteor settings are", Meteor.settings) +Meteor.settings.public.modules.forEach(function(mod, idx, arr){ + TabularTables[mod.entry_type] = new Tabular.Table({ + name: mod.entry_type, + collection: Subjects, + autoWidth: false, + columns: _.map(mod.fields, function(field){ + switch (field.function_name) { + case "get_filter_field": + return get_filter_field(mod.entry_type, field.id, field.name) + break; + case "get_qc_viewer": + return get_qc_viewer(mod.entry_type, field.id, field.name) + break; + case "get_qc_filter_field": + return get_qc_filter_field(mod.entry_type, field.id, field.name) + default: + return {data: field.id, title: field.name} + + } + }) + }) +}) +/* TabularTables.demographic = new Tabular.Table({ name:"demographic", autoWidth: false, collection: Subjects, columns:[ - - + + get_filter_field("demographic", "msid", "msid"), - - - + + + get_filter_field("demographic", "subject_id", "Exam ID"), - - - + + + get_filter_field("demographic", "Study Tag", "Study Tag"), - - - + + + get_filter_field("demographic", "DCM_InstitutionName", "Site"), - - - + + + get_filter_field("demographic", "metrics.DCM_InstitutionName", "Date"), - - + + ] }) @@ -47,31 +71,31 @@ name:"freesurfer", autoWidth: false, collection: Subjects, columns:[ - - + + get_filter_field("freesurfer", "subject_id", "Exam ID"), - - - + + + get_qc_viewer("freesurfer", "name", "Freesurfer ID"), - - - + + + get_qc_filter_field("freesurfer", "quality_check.QC", "QC"), - - - + + + get_filter_field("freesurfer", "checkedBy", "checked by"), - - - + + + get_filter_field("freesurfer", "quality_check.user_assign", "Assigned To"), - - - + + + {data: "quality_check.notes_QC", title: "Notes" } - - + + ] }) @@ -81,31 +105,31 @@ name:"test", autoWidth: false, collection: Subjects, columns:[ - - + + get_filter_field("test", "subject_id", "Exam ID"), - - - + + + get_qc_viewer("test", "name", "View Image"), - - - + + + get_qc_filter_field("test", "quality_check.QC", "QC"), - - - + + + get_filter_field("test", "checkedBy", "checked by"), - - - + + + get_filter_field("test", "quality_check.user_assign", "Assigned To"), - - - + + + {data: "quality_check.notes_QC", title: "Notes" } - - + + ] }) - +*/ diff --git a/imports/ui/module_templates.html b/imports/ui/module_templates.html index c8cfa9e..23d8a1a 100644 --- a/imports/ui/module_templates.html +++ b/imports/ui/module_templates.html @@ -1,129 +1,63 @@ - - - - - - + diff --git a/imports/ui/module_templates.js b/imports/ui/module_templates.js index 5adc82b..d5d6b2e 100644 --- a/imports/ui/module_templates.js +++ b/imports/ui/module_templates.js @@ -48,7 +48,6 @@ render_histogram = function(entry_type){ var metric = Session.get("current_"+entry_type)//"Amygdala" if (metric == null){ var all_metrics = Session.get(entry_type+"_metrics") - if (all_metrics != null){ Session.set("current_"+entry_type, all_metrics[0]) } @@ -59,7 +58,7 @@ render_histogram = function(entry_type){ var filter = get_filter(entry_type) //console.log("filter is", filter) Meteor.call("getHistogramData", entry_type, metric, 20, filter, function(error, result){ - //console.log("result is", result) + var data = result["histogram"] var minval = result["minval"] var maxval = result["maxval"] @@ -76,143 +75,65 @@ render_histogram = function(entry_type){ } +Template.base.helpers({ + modules: function(){ + console.log(Meteor.settings.public.modules) + return Meteor.settings.public.modules + } +}) -Template.demographic.rendered = function() { +Template.module.helpers({ + selector: function(){ + return get_filter(this.entry_type) + }, + table: function(){ + return TabularTables[this.entry_type] + }, + histogram: function(){ + return this.graph_type == "histogram" + }, + date_histogram: function(){ + return this.graph_type == "datehist" + }, + metric: function(){ + return get_metrics(this.entry_type) + }, + currentMetric: function(){ + return Session.get("current_"+this.entry_type) + } +}) - if (!this.rendered){ - this.rendered = true - } +Template.module.events({ + "change #metric-select": function(event, template){ + var metric = $(event.currentTarget).val() + console.log("metric: ", metric) + Session.set("current_"+this.entry_type, metric) + } +}) +Template.base.rendered = function(){ + if (!this.rendered){ + this.rendered = true + } - - this.autorun(function() { + this.autorun(function() { + Meteor.settings.public.modules.forEach(function(self, idx, arr){ + if (self.graph_type == "histogram"){ + console.log("rendering histogram", self.entry_type) + render_histogram(self.entry_type) + } + else if (self.graph_type == "datehist") { Meteor.call("getDateHist", function(error, result){ - do_d3_date_histogram(result, "#d3vis_date_demographic") + do_d3_date_histogram(result, "#d3vis_date_"+self.entry_type) }) - + } }) + }); +} - - - } - - - - - -Template.freesurfer.rendered = function() { - - if (!this.rendered){ - this.rendered = true - } - - - - - this.autorun(function() { - render_histogram("freesurfer") - - }); //end autorun - - - - } - - - - - -Template.test.rendered = function() { - - if (!this.rendered){ - this.rendered = true - } - - - - - this.autorun(function() { - render_histogram("test") - - }); //end autorun - - +Template.body_sidebar.helpers({ + modules: function(){ + return Meteor.settings.public.modules } - - - - - - - -Template.demographic.helpers({ - -selector: function(){return get_filter("demographic")}, - - - -}) - - - -Template.freesurfer.helpers({ - -selector: function(){return get_filter("freesurfer")}, - - - -metric: function(){ - return get_metrics("freesurfer") - }, -currentMetric: function(){ - return Session.get("current_freesurfer") - } - - - }) - - - -Template.test.helpers({ - -selector: function(){return get_filter("test")}, - - - -metric: function(){ - return get_metrics("test") - }, -currentMetric: function(){ - return Session.get("current_test") - } - - - -}) - - - - - - - - Template.freesurfer.events({ - "change #metric-select-freesurfer": function(event, template){ - var metric = $(event.currentTarget).val() - console.log("metric: ", metric) - Session.set("current_freesurfer", metric) - } - }) - - - - Template.test.events({ - "change #metric-select-test": function(event, template){ - var metric = $(event.currentTarget).val() - console.log("metric: ", metric) - Session.set("current_test", metric) - } - }) - From 27884db2cdf4aa95b07da0380b4d22cc07c48bdb Mon Sep 17 00:00:00 2001 From: akeshavan Date: Fri, 23 Jun 2017 12:09:36 -0700 Subject: [PATCH 2/6] fix: added important settings.json file --- settings.json | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 settings.json diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..025aff1 --- /dev/null +++ b/settings.json @@ -0,0 +1,83 @@ +{ + "public": { + "startup_json":"https://dl.dropboxusercontent.com/s/vnohn5nh9ho3j8a/data_rf.json?dl=0", + "modules": [ + {"name": "Exams", + "entry_type": "demographic", + "fields": [ + {"function_name": "get_filter_field", + "id": "msid", + "name": "msid" + }, + {"function_name": "get_filter_field", + "id": "subject_id", + "name": "Exam ID" + }, + {"function_name": "get_filter_field", + "id": "Study Tag", + "name": "Study Tag" + }, + {"function_name": "get_filter_field", + "id": "DCM_InstitutionName", + "name": "Site" + }, + {"function_name": "get_filter_field", + "id": "metrics.DCM_InstitutionName", + "name": "Date" + } + ], + "graph_type":"datehist", + "showgraph": true}, + { + "name": "Freesurfer", + "entry_type": "freesurfer", + "fields": [ + { + "function_name": "get_filter_field", + "id": "subject_id", + "name": "Exam ID" + }, + { + "function_name": "get_qc_viewer", + "id": "name", + "name": "Freesurfer ID" + }, + { + "function_name": "get_qc_filter_field", + "id": "quality_check.QC", + "name": "QC" + }, + { + "function_name": "get_filter_field", + "id": "checkedBy", + "name": "checked by" + }, + { + "function_name": "get_filter_field", + "id": "quality_check.user_assign", + "name": "Assigned To" + }, + { + "function_name": null, + "id": "quality_check.notes_QC", + "name": "Notes" + } + ], + "graph_type": "histogram", + "colormaps": { + "0":{"name": "Grayscale", + "alpha": 1, + "min": 0, + "max": 255 + }, + "1": { + "name": "custom.Freesurfer", + "alpha": 0.5 + } + }, + "staticURL": "https://dl.dropboxusercontent.com/u/9020198/data/", + "usePeerJS": true + } + ] + } +} From 70315797536373e54eb91e880df09f01840609ce Mon Sep 17 00:00:00 2001 From: akeshavan Date: Fri, 23 Jun 2017 12:23:25 -0700 Subject: [PATCH 3/6] fix: removed any generator refs --- imports/startup/fill_empty_db.js | 21 +++--- imports/ui/qc.js | 125 +++++++++++++++---------------- settings.json | 1 + 3 files changed, 73 insertions(+), 74 deletions(-) diff --git a/imports/startup/fill_empty_db.js b/imports/startup/fill_empty_db.js index dec564f..460b1c2 100644 --- a/imports/startup/fill_empty_db.js +++ b/imports/startup/fill_empty_db.js @@ -3,25 +3,24 @@ import {Subjects} from "../api/module_tables.js" if (Meteor.isServer) { // This code only runs on the server // Only publish tasks that are public or belong to the current user - - + + Meteor.startup(function () { //Subjects.remove({}) //console.log("in metero startup function") if (Subjects.find().count() === 0) { //load the json from here: https://www.dropbox.com/s/enb5zemvmu2oqgw/data.json?dl=0 //console.log(JSON.parse(HTTP.get("http:///private/generator.json").content)) - myjson = JSON.parse(Assets.getText("generator.json")); - console.log("myjson", myjson["startup_json"]) - var source_json = myjson["startup_json"] //"https://dl.dropboxusercontent.com/s/vnohn5nh9ho3j8a/data_rf.json?dl=0" + source_json = Meteor.settings.public.startup_json //JSON.parse(Assets.getText("generator.json")); //console.log(HTTP.get(source_json).content) myobject = JSON.parse(HTTP.get(source_json).content) //console.log("my object is", myobject.length) - myobject.forEach(function(val,idx,array){ - Subjects.insert(val) - }) - + if (Meteor.settings.load_if_empty){ + myobject.forEach(function(val,idx,array){ + Subjects.insert(val) + }) + } } }); - - } + +} diff --git a/imports/ui/qc.js b/imports/ui/qc.js index c778e11..d18da1f 100644 --- a/imports/ui/qc.js +++ b/imports/ui/qc.js @@ -15,8 +15,6 @@ import "./painter.js" use_peerJS = true - - addNewDrawing= function(template){ //console.log("in add new drawing") @@ -66,7 +64,8 @@ function arraysEqual(a, b) { var addPapaya = function(data, entry_type, template_instance, callback){ //if (papayaContainers.length == 0){ - Meteor.call("get_generator", entry_type, function(err, res){ + //Meteor.call("get_generator", entry_type, function(err, res){ + var res = _.find(Meteor.settings.public.modules, function(x){return x.entry_type == entry_type}) var params = {} params["images"] = [] var loadableImages = [] @@ -93,7 +92,7 @@ var addPapaya = function(data, entry_type, template_instance, callback){ console.log("papayacontainers is", papayaContainers.pop()) } - + var cmap = res.colormaps if (cmap){ @@ -117,8 +116,8 @@ var addPapaya = function(data, entry_type, template_instance, callback){ else{ params[split_name] = {lut: opts.name, alpha: opts.alpha, min: opts.min, max:opts.max} } - - + + } } console.log("params is", params) @@ -129,9 +128,9 @@ var addPapaya = function(data, entry_type, template_instance, callback){ //callback() }) papaya.Container.allowPropagation = true; - papayaContainers[0].viewer.mindcontrol_template = template_instance//Template.instance() + papayaContainers[0].viewer.mindcontrol_template = template_instance //Template.instance() - }) + //}) @@ -159,7 +158,7 @@ var load_hotkeys = function(template_instance){ contextHotkeys.add({ combo : "d d", callback : function(){ - + var currMode = template_instance.logMode.get() if (currMode == "contour"){ var contours = template_instance.contours.get() @@ -173,20 +172,20 @@ var load_hotkeys = function(template_instance){ template_instance.contours.set(contours) papayaContainers[0].viewer.drawViewer(true) } - + else if (currMode == "point"){ - + } - + else if (currMode == "paint"){ //TODO: undo painting when you have time. var painters = template_instance.painters.get() var currPaint = painters.pop() restore_vals(currPaint) template_instance.painters.set(painters) - + } - + } }) @@ -209,25 +208,25 @@ var load_hotkeys = function(template_instance){ currMode ="paint" } else if (currMode == "paint"){ - currMode = "point" + currMode = "point" } template_instance.logMode.set(currMode) } }) - + contextHotkeys.add({ combo : "z z", callback : function(){ console.log("you want to hide the last overlay") idx = papayaContainers[0].viewer.screenVolumes.length - 1 var isHidden = papayaContainers[0].viewer.screenVolumes[idx].hidden - + if (!isHidden){papaya.Container.hideImage(0, idx)} else{papaya.Container.showImage(0, idx)} //papaya.Container.showImage(0, imageIndex) } - }) - + }) + contextHotkeys.load() } @@ -244,7 +243,7 @@ var sync_templates_decorator = function(template_instance){ return function(data var data = JSON.parse(data) //console.log("you want to sync a template w/ data", data) //console.log("template_instance is", template_instance) - + if (data["action"] == "insert"){ for (var key in data["data"]){ var current = template_instance[key].get() @@ -258,12 +257,12 @@ var sync_templates_decorator = function(template_instance){ return function(data } //console.log("current is", current) template_instance[key].set(current) - + } - + } - - + + if (data["action"] == "update"){ for (var key in data["data"]){ //console.log("you want to update entry in", key, "with uuid", data["data"][key]["uuid"]) @@ -278,9 +277,9 @@ var sync_templates_decorator = function(template_instance){ return function(data } } papayaContainers[0].viewer.drawViewer(true) - - + + }} @@ -295,7 +294,7 @@ Template.view_images.onCreated(function(){ this.painters = new ReactiveVar([]) this.connections = {} Meteor.subscribe("presences") - + if (use_peerJS){ window.peer = new Peer({ key: 'fqw6u5vy67n1att9', // get a free key at http://peerjs.com/peerserver @@ -303,12 +302,12 @@ Template.view_images.onCreated(function(){ config: {'iceServers': [ { url: 'stun:stun.l.google.com:19302' }, { url: 'stun:stun1.l.google.com:19302' }, - ]} + ]} }); - + peer.on('open', function () { console.log("peer ID is", peer.id); - + var current_profile = Meteor.users.findOne({_id: Meteor.userId()}).profile if (!current_profile){ current_profile = {} @@ -321,20 +320,20 @@ Template.view_images.onCreated(function(){ }}) console.log("profile si", Meteor.users.findOne({_id: Meteor.userId()}).profile) }); - + //TODO: sometimes this is null??? Then where do we set the listener? var my_template = this - + peer.on("connection", function(conn){ console.log("conn is", conn) conn.on("data", sync_templates_decorator(my_template)) - + }); } - - - + + + }) @@ -345,45 +344,45 @@ Template.view_images.helpers({ Meteor.subscribe('userList') return Meteor.users.find({}).fetch() }, - + peerUsers: function(){ - - if (use_peerJS){ + + if (use_peerJS){ var userIds = Presences.find().map(function(presence) {return presence.userId;}); // exclude the currentUser var name = get_qc_name() - + var template_instance = Template.instance() var to_return = Meteor.users.find({_id: {$in: userIds, $ne: Meteor.userId()}}); - + if (to_return.count){ var conns = get_open_connections(this) if (!conns.length){ - - + + var dude = Meteor.users.findOne({_id: {$in: userIds, $ne: Meteor.userId()}}) if (dude){ console.log("there are no connections but there is another person out there, so i'm connecting now", dude.username) var conn = peer.connect(dude.profile[name]) conn.on("data", sync_templates_decorator(template_instance)) } - + } - + console.log("a peerjs connection exists, now we add a listener") for(var i = 0; i Date: Fri, 23 Jun 2017 12:27:01 -0700 Subject: [PATCH 4/6] fix: removed generator for python --- private/generator.json | 1 - 1 file changed, 1 deletion(-) delete mode 120000 private/generator.json diff --git a/private/generator.json b/private/generator.json deleted file mode 120000 index 4b98e66..0000000 --- a/private/generator.json +++ /dev/null @@ -1 +0,0 @@ -../imports/python_generate/generator.json \ No newline at end of file From 51f92f9180631d09193d4a287d9018640c76aec6 Mon Sep 17 00:00:00 2001 From: akeshavan Date: Fri, 23 Jun 2017 12:28:30 -0700 Subject: [PATCH 5/6] fix: removed python templates --- .../python_generate/generate_mindcontrol.py | 31 ---- imports/python_generate/generator.json | 120 --------------- imports/python_generate/module_tables.js.tmpl | 30 ---- .../module_templates.html.tmpl | 112 -------------- .../python_generate/module_templates.js.tmpl | 141 ------------------ 5 files changed, 434 deletions(-) delete mode 100644 imports/python_generate/generate_mindcontrol.py delete mode 100644 imports/python_generate/generator.json delete mode 100644 imports/python_generate/module_tables.js.tmpl delete mode 100644 imports/python_generate/module_templates.html.tmpl delete mode 100644 imports/python_generate/module_templates.js.tmpl diff --git a/imports/python_generate/generate_mindcontrol.py b/imports/python_generate/generate_mindcontrol.py deleted file mode 100644 index bf0a174..0000000 --- a/imports/python_generate/generate_mindcontrol.py +++ /dev/null @@ -1,31 +0,0 @@ -__author__ = 'akeshavan' -from jinja2 import Environment, FileSystemLoader -import simplejson as json -import os - -def load_json(filename): - with open(filename,'r') as fp: - data=json.load(fp) - return data - -files_to_generate = [{"filename": "module_tables.js.tmpl", "location":"../api/"}, - {"filename": "module_templates.js.tmpl", "location":"../ui/"}, - {"filename": "module_templates.html.tmpl", "location": "../ui/"}] - -env = Environment(loader=FileSystemLoader('./')) -info = load_json("generator.json") - -for f in files_to_generate: - template = env.get_template(f["filename"]) - outfile = os.path.join(f["location"], f["filename"].replace(".tmpl","")) - print("writing", outfile) - with open(outfile, "w") as q: - q.write(template.render(**info)) -#print(template.render(**info)) - -""" -template = env.get_template("module_templates.js.tmpl") -#print(template.render(**info)) -template = env.get_template("module_templates.html.tmpl") -print(template.render(**info)) -""" \ No newline at end of file diff --git a/imports/python_generate/generator.json b/imports/python_generate/generator.json deleted file mode 100644 index e72bb7a..0000000 --- a/imports/python_generate/generator.json +++ /dev/null @@ -1,120 +0,0 @@ -{"start_tag":"{{", - "end_tag":"}}", - "startup_json":"https://dl.dropboxusercontent.com/s/vnohn5nh9ho3j8a/data_rf.json?dl=0", - "modules": [ - {"name": "Exams", - "entry_type": "demographic", - "fields": [ - {"function_name": "get_filter_field", - "id": "msid", - "name": "msid" - }, - {"function_name": "get_filter_field", - "id": "subject_id", - "name": "Exam ID" - }, - {"function_name": "get_filter_field", - "id": "Study Tag", - "name": "Study Tag" - }, - {"function_name": "get_filter_field", - "id": "DCM_InstitutionName", - "name": "Site" - }, - {"function_name": "get_filter_field", - "id": "metrics.DCM_InstitutionName", - "name": "Date" - } - ], - "graph_type":"datehist", - "showgraph": true}, - { - "name": "Freesurfer", - "entry_type": "freesurfer", - "fields": [ - { - "function_name": "get_filter_field", - "id": "subject_id", - "name": "Exam ID" - }, - { - "function_name": "get_qc_viewer", - "id": "name", - "name": "Freesurfer ID" - }, - { - "function_name": "get_qc_filter_field", - "id": "quality_check.QC", - "name": "QC" - }, - { - "function_name": "get_filter_field", - "id": "checkedBy", - "name": "checked by" - }, - { - "function_name": "get_filter_field", - "id": "quality_check.user_assign", - "name": "Assigned To" - }, - { - "function_name": null, - "id": "quality_check.notes_QC", - "name": "Notes" - } - ], - "graph_type": "histogram", - "colormaps": { - "0":{"name": "Grayscale", - "alpha": 1, - "min": 0, - "max": 255 - }, - "1": { - "name": "custom.Freesurfer", - "alpha": 0.5 - } - }, - "staticURL": "https://dl.dropboxusercontent.com/u/9020198/data/", - "usePeerJS": true - }, -{ - "name": "Test", - "entry_type": "test", - "fields": [ - { - "function_name": "get_filter_field", - "id": "subject_id", - "name": "Exam ID" - }, - { - "function_name": "get_qc_viewer", - "id": "name", - "name": "View Image" - }, - { - "function_name": "get_qc_filter_field", - "id": "quality_check.QC", - "name": "QC" - }, - { - "function_name": "get_filter_field", - "id": "checkedBy", - "name": "checked by" - }, - { - "function_name": "get_filter_field", - "id": "quality_check.user_assign", - "name": "Assigned To" - }, - { - "function_name": null, - "id": "quality_check.notes_QC", - "name": "Notes" - } - ], - "graph_type": "histogram", - "staticURL": "http://localhost:3002/", - "usePeerJS": false - } -]} diff --git a/imports/python_generate/module_tables.js.tmpl b/imports/python_generate/module_tables.js.tmpl deleted file mode 100644 index 5ee1310..0000000 --- a/imports/python_generate/module_tables.js.tmpl +++ /dev/null @@ -1,30 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Mongo } from 'meteor/mongo'; -import { check } from 'meteor/check'; - -export const Subjects = new Mongo.Collection('subjects'); - -import "./table_utils.js" -import "./publications.js" -import "./methods.js" - -TabularTables = {} - -{% for module in modules %} - -TabularTables.{{module.entry_type}} = new Tabular.Table({ -name:"{{module.entry_type}}", - autoWidth: false, - collection: Subjects, - columns:[ - {% for field in module.fields %} - {% if field.function_name %} - {{field.function_name}}("{{module.entry_type}}", "{{field.id}}", "{{field.name}}"), - {% else %} - {data: "{{field.id}}", title: "{{field.name}}" } - {% endif %} - {% endfor %} - ] - }) -{% endfor %} - diff --git a/imports/python_generate/module_templates.html.tmpl b/imports/python_generate/module_templates.html.tmpl deleted file mode 100644 index 5f7aa3a..0000000 --- a/imports/python_generate/module_templates.html.tmpl +++ /dev/null @@ -1,112 +0,0 @@ - - -{% for module in modules %} - - -{% endfor %} - - \ No newline at end of file diff --git a/imports/python_generate/module_templates.js.tmpl b/imports/python_generate/module_templates.js.tmpl deleted file mode 100644 index e549f49..0000000 --- a/imports/python_generate/module_templates.js.tmpl +++ /dev/null @@ -1,141 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Template } from 'meteor/templating'; - -import './module_templates.html'; -import "./d3_plots.js" - - -get_filter = function(entry_type){ - - var globalSelector = Session.get("globalSelector") - var myselect = {} - myselect["entry_type"] = entry_type - - if (globalSelector){ - globalKeys = Object.keys(globalSelector) - //console.log("global keys are", globalKeys, globalKeys.indexOf(entry_type)) - if (globalKeys.indexOf(entry_type) >= 0){ - var localKeys = Object.keys(globalSelector[entry_type]) - //console.log("local keys are", localKeys) - for (i=0;i Date: Fri, 23 Jun 2017 12:52:23 -0700 Subject: [PATCH 6/6] fix: added new freesurfer settings file, and fixed the style a little bit --- client/main.css | 7 +- settings_freesurfer.json | 158 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 settings_freesurfer.json diff --git a/client/main.css b/client/main.css index 1428942..7ea230b 100644 --- a/client/main.css +++ b/client/main.css @@ -2,6 +2,11 @@ body { padding-top: 50px; } +#metric-select { + margin-bottom: 10px; + margin-top: 10px; +} + .container { margin-left: 300px } @@ -368,5 +373,3 @@ h4 td, th{ color: #333; white-space: nowrap; } - - diff --git a/settings_freesurfer.json b/settings_freesurfer.json new file mode 100644 index 0000000..a964f1f --- /dev/null +++ b/settings_freesurfer.json @@ -0,0 +1,158 @@ +{ + "public": { + "startup_json":"https://dl.dropboxusercontent.com/s/vnohn5nh9ho3j8a/data_rf.json?dl=0", + "modules": [ + { + "name": "Brainmask", + "entry_type": "brainmask", + "fields": [ + { + "function_name": "get_filter_field", + "id": "subject_id", + "name": "Exam ID" + }, + { + "function_name": "get_qc_viewer", + "id": "name", + "name": "Freesurfer ID" + }, + { + "function_name": "get_qc_filter_field", + "id": "quality_check.QC", + "name": "QC" + }, + { + "function_name": "get_filter_field", + "id": "checkedBy", + "name": "checked by" + }, + { + "function_name": "get_filter_field", + "id": "quality_check.user_assign", + "name": "Assigned To" + }, + { + "function_name": null, + "id": "quality_check.notes_QC", + "name": "Notes" + } + ], + "graph_type": "histogram", + "colormaps": { + "0":{"name": "Grayscale", + "alpha": 1, + "min": 0, + "max": 255 + }, + "1": { + "name": "Red Overlay", + "alpha": 0.2, + "min": 0, + "max": 2000 + } + }, + "staticURL": "http://localhost:3002/", + "usePeerJS": true + }, + { + "name": "White Matter", + "entry_type": "wm", + "fields": [ + { + "function_name": "get_filter_field", + "id": "subject_id", + "name": "Exam ID" + }, + { + "function_name": "get_qc_viewer", + "id": "name", + "name": "Freesurfer ID" + }, + { + "function_name": "get_qc_filter_field", + "id": "quality_check.QC", + "name": "QC" + }, + { + "function_name": "get_filter_field", + "id": "checkedBy", + "name": "checked by" + }, + { + "function_name": "get_filter_field", + "id": "quality_check.user_assign", + "name": "Assigned To" + }, + { + "function_name": null, + "id": "quality_check.notes_QC", + "name": "Notes" + } + ], + "graph_type": "histogram", + "colormaps": { + "0":{"name": "Grayscale", + "alpha": 1, + "min": 0, + "max": 255 + }, + "1": { + "name": "Spectrum", + "alpha": 0.5 + } + }, + "staticURL": "http://localhost:3002/", + "usePeerJS": true + }, + { + "name": "Segmentation", + "entry_type": "aparcaseg", + "fields": [ + { + "function_name": "get_filter_field", + "id": "subject_id", + "name": "Exam ID" + }, + { + "function_name": "get_qc_viewer", + "id": "name", + "name": "Freesurfer ID" + }, + { + "function_name": "get_qc_filter_field", + "id": "quality_check.QC", + "name": "QC" + }, + { + "function_name": "get_filter_field", + "id": "checkedBy", + "name": "checked by" + }, + { + "function_name": "get_filter_field", + "id": "quality_check.user_assign", + "name": "Assigned To" + }, + { + "function_name": null, + "id": "quality_check.notes_QC", + "name": "Notes" + } + ], + "graph_type": "histogram", + "colormaps": { + "0":{"name": "Grayscale", + "alpha": 1, + "min": 0, + "max": 255 + }, + "1": { + "name": "custom.Freesurfer", + "alpha": 0.5 + } + }, + "staticURL": "http://localhost:3002/", + "usePeerJS": true + }] +} +}