Unverified Commit eb5e849a authored by katja heuer's avatar katja heuer Committed by GitHub
Browse files

Merge pull request #8 from neuroanatomy/master

merge
parents 58c58e38 90af5c66
......@@ -89,7 +89,7 @@ module.exports = {
"max-lines": "error",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "error",
"max-statements": ["error", 100],
"max-statements-per-line": "off",
"multiline-ternary": [
"error",
......
:sparkles: We are the brain mappers! / :sparkles:
Here, we are segmenting corpus callosum of 34 different primate species [**Green Monkey**](http://brainbox.pasteur.fr/mri?url=https://drive.google.com/uc?id=1l7wVJ39a7eaKWnhrFA6BRXs7VmfVnOjD&view=sag&slice=108). Once you clicked the link, you will find our work in progress in the brain catalogue primate corpus callosum project. You can **join our segmentation sprint any time!** You can also choose a different species to work on, if you prefer! Any contributions are featured below. More information on segmenting can be found in our [Annotations.md] file(https://github.com/neuroanatomy/BrainBox/blob/master/Annotations.md).
<img width="705" alt="screenshot 2018-12-07 at 12 22 09" src="https://user-images.githubusercontent.com/45625538/49645111-f289a200-fa1a-11e8-871b-96ec7a10778a.png">
**Our BrainMapper team**
Name: **Eleonora Galletti**
GitHub: @eleonoragalletti
Name: **Margherita Calderan**
GitHub: @Margheritacalderan
Name: **Corinna Moradei**
GitHub: @CorinnaMoradei
Name: **Francesco Alberti**
GitHub: @FrAlberti
Name: **Yasmina Ardern**
GitHub: @YasminaArdern
......@@ -5,7 +5,7 @@
[![Join the chat at https://gitter.im/OpenNeuroLab-Brainbox/Lobby](https://badges.gitter.im/OpenNeuroLab-Brainbox/Lobby.svg)](https://gitter.im/OpenNeuroLab-Brainbox/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
BrainBox is a web application for the collaborative curation of neuroimaging data
BrainBox is a Web application for the collaborative curation of neuroimaging data
available online. You can share, visualise and annotate MRI brain
data in real-time, collaboratively. BrainBox will provide the means to create a
layer of collaborative annotation over all the available MRI data without
......
/* eslint-disable no-sync */
"use strict";
/*
Atlas Maker Server
Roberto Toro, 25 July 2014
Launch using > node atlasMakerServer.js
*/
......@@ -47,7 +48,7 @@ if (DOCKER_DEVELOP === '1') {
// Create a livereload server
const hotServer = livereload.createServer({
// Reload on changes to these file extensions.
exts: [ 'json', 'mustache' ],
exts: ['json', 'mustache'],
// Print debug info
debug: true
});
......@@ -123,7 +124,7 @@ const GithubStrategy = require('passport-github').Strategy;
passport.use(new GithubStrategy(
JSON.parse(fs.readFileSync(dirname + "/github-keys.json")),
function (accessToken, refreshToken, profile, done) {return done(null, profile); }
function (accessToken, refreshToken, profile, done) { return done(null, profile); }
));
app.use(session({
secret: "a mi no me gusta la sémola",
......@@ -146,7 +147,7 @@ function ensureAuthenticated(req, res, next) {
}
res.redirect('/');
}
app.get('/secure-route-example', ensureAuthenticated, function (req, res) {res.send("access granted"); });
app.get('/secure-route-example', ensureAuthenticated, function (req, res) { res.send("access granted"); });
app.get('/logout', function (req, res) {
req.logout();
res.redirect(req.session.returnTo || '/');
......@@ -195,12 +196,7 @@ app.get('/auth/github/callback',
// { Token authentication
global.tokenAuthentication = function (req, res, next) {
tracer.log('>> Check token');
let token;
if (req.params.token)
token = req.params.token;
if(req.query.token)
token = req.query.token;
const token = req.params.token | req.query.token;
if (!token) {
tracer.log('>> No token');
next();
......@@ -276,6 +272,7 @@ app.get('/api/getAtlasBackups', (req, res) => {
res.render('error', {
message: "Missing source, atlasProject or atlasName"
});
return;
}
......@@ -360,7 +357,7 @@ app.post('/api/log', (req, res) => {
length = parseFloat(result.value.length);
}
var sum = parseFloat(json.value.length) + length;
req.db.get('log').update(obj,{$set:{
req.db.get('log').update(obj, {$set:{
"value.length":sum,
date: (new Date()).toJSON()
}}, {upsert: true});
......@@ -426,4 +423,4 @@ app.use(function (err, req, res, next) {
});
});
module.exports = app;
\ No newline at end of file
module.exports = app;
......@@ -159,7 +159,7 @@ const atlasMakerServer = (function() {
traceLog: function traceLog(f, l) {
if(typeof l === 'undefined' || me.debug>l) {
tracer.log("" + (f.name) + " " + (f.caller?(f.caller.name||"annonymous"): "root"));
tracer.log(String(f.name) + " " + (f.caller?(f.caller.name||"annonymous"): "root"));
}
},
niiTag: bufferTag("nii", 8),
......
......@@ -47,7 +47,7 @@ gulp.task('pack-atlasMaker-dev', ['download', 'pack-resources'], function () {
gulp.task('pack-brainbox', ['pack-atlasMaker'], function () {
return gulp.src(brainboxFiles)
.pipe(gulpif(file => !(file.path.includes('.min.js')), uglify()))
.pipe(gulpif((file) => !(file.path.includes('.min.js')), uglify()))
.pipe(concat('brainbox.js'))
.pipe(gulp.dest(jsdest))
.pipe(rename('brainbox.min.js'))
......@@ -56,7 +56,7 @@ gulp.task('pack-brainbox', ['pack-atlasMaker'], function () {
gulp.task('pack-atlasMaker', ['download', 'pack-resources'], function () {
return gulp.src(atlasmakerFiles)
.pipe(gulpif(file => !(file.path.includes('.min.js')), uglify()))
.pipe(gulpif((file) => !(file.path.includes('.min.js')), uglify()))
.pipe(concat('atlasMaker.js'))
.pipe(gulp.dest(jsdest))
.pipe(rename('atlasMaker.min.js'))
......
This diff is collapsed.
......@@ -39,7 +39,7 @@
"merge": ">=1.2.1",
"mongodb": "^3.0.4",
"monk": "^6.0.5",
"morgan": "~1.9.0",
"morgan": "^1.9.1",
"multer": "^1.2.0",
"mustache-express": "^1.2.2",
"passport": "^0.4.0",
......@@ -76,7 +76,6 @@
"livereload": "^0.7.0",
"mocha": "^5.0.4",
"puppeteer": "^1.2.0",
"raw-loader": "^0.5.1",
"style-loader": "^0.23.0",
"url-loader": "^1.1.1",
"webpack": "^4.20.0",
......
#!/bin/bash
cd /brainbox
cd /brainbox || exit
npm install
node ./bin/www
......@@ -5,10 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.png" />
<title>{{title}}</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/ui.css" />
<link href='https://fonts.googleapis.com/css?family=Roboto:100' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
</head>
<body>
......
......@@ -81,6 +81,9 @@
</div>
</div>
<script>
const projectURL = '{{{projectURL}}}';
</script>
<script src="/js/project-new-page.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
......
......@@ -344,12 +344,14 @@ export var AtlasMakerWidget = {
* @param {string} path Path to script, either a local path or a url
* @param {function} testScriptPresent Function to test if the script is already present.
* If undefined, the script will be loaded.
* @returns {object} A promise
*/
loadScript: function loadScript(path, testScriptPresent) {
var def = new $.Deferred();
if(testScriptPresent && testScriptPresent()) {
console.log("[loadScript] Script",path,"already present, not loading it again");
return def.resolve().promise();
}
var s = document.createElement("script");
......@@ -359,6 +361,7 @@ export var AtlasMakerWidget = {
def.resolve();
};
document.body.appendChild(s);
return def.promise();
},
......
......@@ -33,23 +33,23 @@ export var BrainBox={
* @returns {string} A hash
*/
hash: function hash(str) {
let v0 = 0;
let v1;
const abc="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let i;
for(i=0; i<str.length; i++) {
const ch=str.charCodeAt(i);
v0=((v0<<5)-v0)+ch;
v0&=v0;
let i, res, v, v0, v1;
const abc = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const sz = abc.length;
v0 = 0;
for(i = 0; i<str.length; i++) {
const ch = str.charCodeAt(i);
v0 = ((v0<<5)-v0)+ch;
v0 &= v0;
}
const sz=abc.length;
let v;
let res="";
for(i=0; i<8; i++) {
v1=parseInt(v0/sz);
v=Math.abs(v0-v1*sz);
res+=abc[v];
v0=v1;
res = "";
for(i = 0; i<8; i++) {
v1 = parseInt(v0/sz);
v = Math.abs(v0-v1*sz);
res += abc[v];
v0 = v1;
}
return res;
......@@ -276,15 +276,15 @@ export var BrainBox={
stored={version:BrainBox.version,history:[]};
obj0 = {};
}
obj1 = {
obj1 = {
url:BrainBox.info.source,
view:AtlasMakerWidget.User.view?AtlasMakerWidget.User.view.toLowerCase():"sag",
slice:AtlasMakerWidget.User.slice?AtlasMakerWidget.User.slice:0,
lastVisited:(new Date()).toJSON()
};
$.extend(obj0, obj1);
stored.history.push(obj0);
localStorage.AtlasMaker=JSON.stringify(stored);
*/
......
......@@ -19,7 +19,7 @@ function goToURL() {
*/
function testWebSockets() {
return new Promise(function(resolve, reject) {
var host = "ws://ws.websocketstest.com:8080/service";
var host = "ws://websocketstest.com:8080/service";
var ws;
if (window.WebSocket) {
......
/* global $ */
import $ from 'jquery';
import 'jquery-ui/themes/base/core.css';
import 'jquery-ui/themes/base/theme.css';
import 'jquery-ui/themes/base/autocomplete.css';
import 'jquery-ui/ui/core';
import 'jquery-ui/ui/widgets/autocomplete';
import * as DOMPurify from '../../../downloads/purify.min.js';
import '../style/style.css';
......@@ -46,6 +52,6 @@ $("#projectName").on('keyup',function(e) {
});
$("#createProject").click(function cancelChanges(){location.pathname='/project/'+$("#projectName").val()+'/settings'});
$("#cancelChanges").click(function cancelChanges(){location.pathname='{{{projectURL}}}'});
$("#cancelChanges").click(function cancelChanges(){location.pathname=projectURL});
$("#addProject").click(function(){location="/project/new"});
......@@ -8,16 +8,14 @@ for(const item of list) {
const arr = item.split('/');
const key = arr[arr.length-2]; // module name is directory's name
entries[key] = item;
};
}
console.log(entries);
module.exports = {
mode: 'development',
entry: entries,
devtool: 'eval-source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
],
plugins: [new CleanWebpackPlugin(['dist'])],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'view/atlasMaker/dist/atlasMaker-tools')
......@@ -33,9 +31,7 @@ module.exports = {
},
{
test: /\.(png|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
},
{
test: /\.(svg)$/,
......@@ -48,10 +44,8 @@ module.exports = {
},
{
test: /\.(html)$/,
use: [
'html-loader'
]
use: ['html-loader']
}
]
}
};
\ No newline at end of file
};
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -9,9 +9,7 @@ module.exports = {
atlasmaker: './view/atlasMaker/src/atlasmaker.js'
},
devtool: 'eval-source-map',
plugins: [
new CleanWebpackPlugin(['dist'])
],
plugins: [new CleanWebpackPlugin(['dist'])],
output: {
filename: 'atlasmaker.js',
library: 'AtlasMakerWidget',
......@@ -29,15 +27,11 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
},
{
test: /\.(html)$/,
use: [
'html-loader'
]
use: ['html-loader']
}
]
}
......
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -32,9 +32,7 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
}
]
}
......
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
......@@ -35,9 +35,7 @@ module.exports = {
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
use: ['file-loader']
}
]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment