Downloading from source to server..."); - $.getJSON("/php/brainbox.php",{ - action: "download", - url: param.url //,hash: BrainBox.hash(param.url) - }).done(function from_configureBrainBox(data) { - // Configure MRI into atlasMaker - //data=JSON.parse(data); - if(data.success==false) { - date=new Date(); - $("#msgLog").append("
ERROR: "+data.message+"."); - console.log("
ERROR: "+data.message+"."); - def.reject(); - return; - } - BrainBox.info=data; - - var arr=param.url.split("/"); - var name=arr[arr.length-1]; - date=new Date(); - $("#msgLog").append("
Downloading from server...");
-
- param.dim=BrainBox.info.dim; // this allows to keep dim and pixdim through annotation changes
- param.pixdim=BrainBox.info.pixdim;
-
- // re-instance stored configuration
- var stored=localStorage.AtlasMaker;
- if(stored) {
- var stored=JSON.parse(stored);
- if(stored.version && stored.version==BrainBox.version) {
- for(var i=0;i ERROR: "+data.message+".");
console.log(" ERROR: "+data.message+".");
- def.reject();
- return;
+ return def.promise().reject();
}
BrainBox.info=data;
@@ -141,8 +140,8 @@ var BrainBox={
stored={version:BrainBox.version,history:[]};
stored.history.push({
url:BrainBox.info.source,
- view:AtlasMakerWidget.User.view.toLowerCase(),
- slice:AtlasMakerWidget.User.slice,
+ view:AtlasMakerWidget.User.view?AtlasMakerWidget.User.view.toLowerCase():"sag",
+ slice:AtlasMakerWidget.User.slice?AtlasMakerWidget.User.slice:0,
lastVisited:(new Date()).toJSON()
});
localStorage.AtlasMaker=JSON.stringify(stored);
@@ -200,14 +199,14 @@ var BrainBox={
var date=new Date();
// add data to annotations array
BrainBox.info.mri.atlas.push({
- name:"Untitled",
- project:"Untitled",
+ name:"",
+ project:"",
access: "Read/Write",
created: date.toJSON(),
modified: date.toJSON(),
filename: Math.random().toString(36).slice(2)+".nii.gz", // automatically generated filename
labels: "/labels/foreground.json",
- owner: "/user/"+AtlasMakerWidget.User.username,
+ owner: AtlasMakerWidget.User.username,
type: "volume"
});
diff --git a/public/lib/.DS_Store b/public/lib/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6
Binary files /dev/null and b/public/lib/.DS_Store differ
diff --git a/public/project/FCP1000/info.json b/public/project/FCP1000/info.json
new file mode 100644
index 0000000000000000000000000000000000000000..6c3ff3212046feffed4eaa8501031ff531b50cc9
--- /dev/null
+++ b/public/project/FCP1000/info.json
@@ -0,0 +1,230 @@
+{
+ "name": "FCP1000",
+ "shortname":"FCP1000",
+ "url":"http://www.nitrc.org/projects/fcon_1000",
+ "brainboxURL":"http://brainbox.pasteur.fr/project/FCP1000",
+ "created": "2016-08-06T17:50:31.572Z",
+ "owner":"r03ert0",
+ "collaborators":[
+ ],
+ "files":[
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub23750-sub23750-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub17017-sub17017-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub19738-sub19738-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub23927-sub23927-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub29158-sub29158-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub30072-sub30072-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub31837-sub31837-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub37548-sub37548-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub52358-sub52358-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub54257-sub54257-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub54329-sub54329-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub76160-sub76160-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub73823-sub73823-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub77572-sub77572-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub80221-sub80221-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub81887-sub81887-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub90893-sub90893-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub91622-sub91622-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub96234-sub96234-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub00031-sub00031-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub90658-sub90658-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub01903-sub01903-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub03557-sub03557-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub04097-sub04097-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub94042-sub94042-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub85922-sub85922-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub86414-sub86414-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub12855-sub12855-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub06716-sub06716-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub06204-sub06204-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub14388-sub14388-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub23506-sub23506-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub18913-sub18913-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub27711-sub27711-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub27519-sub27519-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub27797-sub27797-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub28092-sub28092-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub33248-sub33248-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub36736-sub36736-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub27536-sub27536-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub38279-sub38279-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub40143-sub40143-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub46870-sub46870-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub47066-sub47066-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub48632-sub48632-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub49134-sub49134-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub61418-sub61418-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub61908-sub61908-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub57028-sub57028-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub63767-sub63767-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub66585-sub66585-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub67166-sub67166-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub68050-sub68050-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub73082-sub73082-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub75506-sub75506-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub77520-sub77520-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub77281-sub77281-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub81464-sub81464-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub47791-sub47791-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub54976-sub54976-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub85681-sub85681-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub82625-sub82625-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub87568-sub87568-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub91116-sub91116-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub91556-sub91556-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub86111-sub86111-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub95068-sub95068-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub00917-sub00917-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub09931-sub09931-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub14692-sub14692-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub16666-sub16666-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub17004-sub17004-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub17987-sub17987-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub97162-sub97162-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub18955-sub18955-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub21350-sub21350-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub23607-sub23607-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub24237-sub24237-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub28782-sub28782-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub30157-sub30157-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub36386-sub36386-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub39259-sub39259-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub44912-sub44912-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub45019-sub45019-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub91966-sub91966-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub45852-sub45852-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub46312-sub46312-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub49975-sub49975-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub50771-sub50771-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub51182-sub51182-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub53971-sub53971-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub56108-sub56108-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub56084-sub56084-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub55176-sub55176-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub56333-sub56333-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub56582-sub56582-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub58967-sub58967-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub58677-sub58677-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub59359-sub59359-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub63196-sub63196-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub64463-sub64463-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub67948-sub67948-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub73547-sub73547-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub75919-sub75919-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub76042-sub76042-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub76378-sub76378-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub77073-sub77073-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub61779-sub61779-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub84314-sub84314-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub87784-sub87784-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub87910-sub87910-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub91468-sub91468-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub93170-sub93170-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub98971-sub98971-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub99479-sub99479-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub00448-sub00448-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub00623-sub00623-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub02382-sub02382-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub02503-sub02503-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub07286-sub07286-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub05208-sub05208-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub08255-sub08255-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub08806-sub08806-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub09539-sub09539-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub13789-sub13789-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub10582-sub10582-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub13384-sub13384-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub13478-sub13478-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub20718-sub20718-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub22674-sub22674-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub26183-sub26183-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub26796-sub26796-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub28422-sub28422-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub16607-sub16607-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub28795-sub28795-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub28808-sub28808-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub29353-sub29353-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub19395-sub19395-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub30003-sub30003-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub30623-sub30623-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub32549-sub32549-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub33677-sub33677-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub34252-sub34252-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub35262-sub35262-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub40482-sub40482-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub40217-sub40217-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub37140-sub37140-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub44077-sub44077-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub44395-sub44395-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub47658-sub47658-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub47753-sub47753-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub35370-sub35370-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub48210-sub48210-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub49215-sub49215-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub41764-sub41764-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub53282-sub53282-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub53801-sub53801-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub48830-sub48830-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub54887-sub54887-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub55114-sub55114-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub55656-sub55656-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub41546-sub41546-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub51677-sub51677-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub57738-sub57738-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub59589-sub59589-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub59739-sub59739-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub59914-sub59914-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub62937-sub62937-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub63280-sub63280-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub65921-sub65921-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub66085-sub66085-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub68850-sub68850-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub66794-sub66794-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub70595-sub70595-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub72135-sub72135-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub71932-sub71932-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub73490-sub73490-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub76325-sub76325-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub77431-sub77431-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub76678-sub76678-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub82754-sub82754-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub86203-sub86203-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub85442-sub85442-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub86516-sub86516-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub78297-sub78297-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub86665-sub86665-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub87217-sub87217-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub82228-sub82228-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub89049-sub89049-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub92028-sub92028-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub93262-sub93262-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub93975-sub93975-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub94103-sub94103-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub94945-sub94945-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub95400-sub95400-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub95971-sub95971-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub97008-sub97008-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub98802-sub98802-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub94169-sub94169-000-MPRAGE/t1.nii.gz",
+ "https://dl.dropboxusercontent.com/u/9020198/data/sub98317-sub98317-000-MPRAGE/t1.nii.gz"
+ ],
+
+ "access":{
+ "files":{
+ "view":"public",
+ "add":"collaborators",
+ "edit":"collaborators",
+ "remove":"owner"
+ },
+ "collaborators": {
+ "view":"public",
+ "add":"owner",
+ "remove":"owner"
+ }
+ },
+ "tags":[
+ "human",
+ "open data"
+ ]
+}
diff --git a/public/project/braincatalogue-dev/info.json b/public/project/braincatalogue-dev/info.json
new file mode 100644
index 0000000000000000000000000000000000000000..3c91d52e0f3934e19696a7cb644d8c0aa8e071a0
--- /dev/null
+++ b/public/project/braincatalogue-dev/info.json
@@ -0,0 +1,67 @@
+{
+ "name": "Brain Catalogue",
+ "shortname":"braincatalogue",
+ "url":"http://braincatalogue.org",
+ "brainboxURL":"http://brainbox.dev/project/braincatalogue",
+ "created": "2016-07-11T16:03:47+0200",
+ "owner":"r03ert0",
+ "collaborators":[
+ "katjaq",
+ "aniv0s"
+ ],
+ "files":[
+ "http://braincatalogue.dev/data/Baboon/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Black_rhinoceros/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Blackbuck/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Bottlenose_dolphin/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Cat/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Cheetah/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Chimpanzee/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Crab-eating_macaque/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Ferret/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Giant_panda/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Giraffe/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Gorilla/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Gray_wolf/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Grey-cheeked_mangabey/MRI.nii.gz",
+ "http://braincatalogue.dev/data/House_mouse/Mouse.nii.gz",
+ "http://braincatalogue.dev/data/Human/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/La_Plata_dolphin/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Leopard/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Lion/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Night_monkey/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Nile_crocodile/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Nursehound/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Okapi/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Orangutan/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Ostrich/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Plains_zebra/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Platypus/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Red_kangaroo/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Red_squirrel/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Red-necked_wallaby/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Rhesus_macaque/MRI.nii.gz",
+ "http://braincatalogue.dev/data/Sloth_bear/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Slow_loris/MRI-n4.nii.gz",
+ "http://braincatalogue.dev/data/Thylacine/MRI.nii.gz",
+ "http://braincatalogue.dev/data/White-headed_capuchin/MRI.nii.gz"
+ ],
+
+ "access":{
+ "files":{
+ "view":"public",
+ "add":"collaborators",
+ "edit":"collaborators",
+ "remove":"owner"
+ },
+ "collaborators": {
+ "view":"public",
+ "add":"owner",
+ "remove":"owner"
+ }
+ },
+ "tags":[
+ "comparative anatomy",
+ "non-human"
+ ]
+}
\ No newline at end of file
diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css
index 997983e78cd7bdb6b89e25e446f48ca3d283ee4f..e2a12d9c6577ceddba4eed5ad072f8226408e731 100644
--- a/public/stylesheets/style.css
+++ b/public/stylesheets/style.css
@@ -254,7 +254,7 @@
width:100%;
height:100%;
text-align:left;
- background:#333;
+ background-color:#333;
z-index:21;
}
.label-color {
@@ -295,10 +295,13 @@ th {
font-weight: bold;
border-bottom:thin solid white;
}
-#info td {
+table#annotations {
+ width:100%;
+}
+#annotations td {
font-weight: normal;
}
-#info th, #info td {
+#annotations th, #annotations td {
padding:4px;
}
ul {
@@ -330,9 +333,11 @@ img.icon {
cursor:pointer;
}
-#NAATlogo {
- position:relative;
- z-index:25;
+#NAATlogo.project-page {
+ position:absolute;
+ right:10px;
+ top:10px;
+ z-index:25;
}
/* Content: Splash
@@ -356,7 +361,7 @@ img.icon {
select {
border:none;
- background:none;
+ background:none; /* no color, no decoration */
color:white;
-webkit-appearance: none;
-moz-appearance: none;
@@ -379,7 +384,7 @@ select {
height:20px;
top:50%;
left:100%;
- background:#333;
+ background-color:#333;
transform:translate(-50%, -50%);
border-radius:5px;
z-index:5;
diff --git a/public/templates/adjust.html b/public/templates/adjust.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e510be310e6d083ae10454865f2fcc1067e875c
--- /dev/null
+++ b/public/templates/adjust.html
@@ -0,0 +1,95 @@
+
- The file is maybe corrupt? Loading..."+layer.name);
+ link.html("
"+atlas.name);
break;
}
- case "jpg": {
+ case 'jpg': {
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL(msg.data);
var img = new Image();
+
+ me.isMRILoaded=true; // receiving a jpg is proof of a loaded MRI
+
img.onload=function from_initSocketConnection(){
var flagFirstImage=(me.brain_img.img==null);
me.brain_img.img=img;
@@ -1280,6 +1315,9 @@ var AtlasMakerWidget = {
if(flagFirstImage || me.flagLoadingImg.view!=me.User.view ||me.flagLoadingImg.slice!=me.User.slice) {
me.sendRequestSliceMessage();
}
+
+ // remove loading indicator
+ $("#loadingIndicator").hide();
}
img.src=imageUrl;
@@ -1293,7 +1331,6 @@ var AtlasMakerWidget = {
// Message: interaction message
var data=JSON.parse(msg.data);
- if(me.debug) console.log("message: "+data.type);
// [deprecated]
// If we receive a message from an unknown user,
@@ -1351,7 +1388,7 @@ var AtlasMakerWidget = {
var u=data.uid;
- if(me.Collab[u]==undefined) {
+ if(me.Collab[u]===undefined) {
try {
//var msg=""+data.user.username+" entered atlas "+data.user.specimenName+"/"+data.user.atlasFilename+"
"
var msg=""+data.user.username+" entered
"
@@ -1386,6 +1423,7 @@ var AtlasMakerWidget = {
receiveChatMessage: function receiveChatMessage(data) {
var me=AtlasMakerWidget;
var l=me.traceLog(receiveChatMessage);if(l)console.log(l);
+ console.log(data);
var theView=me.Collab[data.uid].view;
var theSlice=me.Collab[data.uid].slice;
@@ -1408,7 +1446,7 @@ var AtlasMakerWidget = {
},
receivePaintMessage: function receivePaintMessage(data) {
var me=AtlasMakerWidget;
- var l=me.traceLog(receivePaintMessage);if(l)console.log(l);
+ var l=me.traceLog(receivePaintMessage,3);if(l)console.log(l);
var msg=data.data;
var u=data.uid; // user
@@ -1448,7 +1486,11 @@ var AtlasMakerWidget = {
if(me.flagLoadingImg.loading==true)
return;
try {
- me.socket.send(JSON.stringify({type:"requestSlice"}));
+ me.socket.send(JSON.stringify({
+ type:"requestSlice",
+ view:me.User.view,
+ slice:me.User.slice
+ }));
me.flagLoadingImg.loading=true;
me.flagLoadingImg.view=me.User.view;
me.flagLoadingImg.slice=me.User.slice;
@@ -1563,7 +1605,7 @@ var AtlasMakerWidget = {
].join("\n"));
me.canvas = me.container.find('canvas')[0];
me.context = me.canvas.getContext('2d');
-
+
// Add div to display slice number
me.container.find("#resizable").append("");
@@ -1600,7 +1642,7 @@ var AtlasMakerWidget = {
$(document).keydown(function(e){me.keyDown(e)});
// configure annotation tools
- me.slider($(".slider#slice"),me.changeSlice);
+ me.slider($(".slider#slice"),function(x){me.changeSlice(Math.round(x))});
me.chose($(".chose#plane"),me.changeView);
me.chose($(".chose#paintTool"),me.changeTool);
me.chose($(".chose#penSize"),me.changePenSize);
@@ -1619,7 +1661,7 @@ var AtlasMakerWidget = {
})
.then(function from_initAtlasMaker() {
// Init web socket connection
- me.initSocketConnection();
+ return me.initSocketConnection();
}).then(function() {
def.resolve()
});
@@ -1630,6 +1672,8 @@ var AtlasMakerWidget = {
var me=AtlasMakerWidget;
var l=me.traceLog(configureAtlasMaker);if(l)console.log(l);
+ $("#loadingIndicator").show();
+
// Load segmentation labels
return $.getJSON(info.mri.atlas[index].labels,function from_configureAtlasMaker(d){me.configureOntology(d);})
.then(function from_configureAtlasMaker() {
@@ -1648,6 +1692,7 @@ var AtlasMakerWidget = {
$(".chose#plane .a:contains('"+view+"')").addClass("pressed");
}
+ me.sendUserDataMessage();
me.sendUserDataMessage("sendAtlas");
def.resolve();
});
@@ -1680,11 +1725,18 @@ var AtlasMakerWidget = {
me.User.mri=info.mri.brain;
me.User.specimenName=me.name;
me.User.atlasFilename=info.mri.atlas[index].filename;
+ me.User.isMRILoaded=false;
// TODO: it's silly to have to put vol dim twice...
// (first here, once again further down)
me.User.dim=info.dim;
me.User.pixdim=info.pixdim;
+
+ // compute space transformations
+ me.User.v2w=info.voxel2world;
+ me.User.wori=info.worldOrigin;
+ me.computeS2VTransformation();
+ me.testS2VTransformation();
me.flagLoadingImg={loading:false};
@@ -1696,9 +1748,141 @@ var AtlasMakerWidget = {
me.brain_pixdim=info.pixdim;
else
me.brain_pixdim=[1,1,1];
+
return def.resolve().promise();
},
+ /*
+ {Linear algebra
+ */
+ computeS2VTransformation: function computeS2VTransformation() {
+ var me=AtlasMakerWidget;
+ var l=me.traceLog(computeS2VTransformation);if(l)console.log(l);
+
+ var v2w=me.User.v2w;
+ var wori=me.User.wori;
+ var wpixdim=me.subVecVec(me.mulMatVec(v2w,[1,1,1]),me.mulMatVec(v2w,[0,0,0]));
+ var wvmax=me.addVecVec(me.mulMatVec(v2w,me.User.dim),wori);
+ var wvmin=me.addVecVec(me.mulMatVec(v2w,[0,0,0]),wori);
+ var wmin=[Math.min(wvmin[0],wvmax[0]),Math.min(wvmin[1],wvmax[1]),Math.min(wvmin[2],wvmax[2])];
+ var wmax=[Math.max(wvmin[0],wvmax[0]),Math.max(wvmin[1],wvmax[1]),Math.max(wvmin[2],wvmax[2])];
+ var w2s=[[1/Math.abs(wpixdim[0]),0,0],[0,1/Math.abs(wpixdim[1]),0],[0,0,1/Math.abs(wpixdim[2])]];
+ var s2w=me.invMat(w2s);
+
+ console.log(["v2w",v2w, "wori",wori, "wpixdim",wpixdim, "wvmax",wvmax, "wvmin",wvmin, "wmin",wmin, "wmax",wmax, "w2s",w2s]);
+
+ me.User.s2v = {
+ sdim: [(wmax[0]-wmin[0])/Math.abs(wpixdim[0]),(wmax[1]-wmin[1])/Math.abs(wpixdim[1]),(wmax[2]-wmin[2])/Math.abs(wpixdim[2])],
+ s2w: s2w,
+ sori: [-wmin[0]/Math.abs(wpixdim[0]),-wmin[1]/Math.abs(wpixdim[1]),-wmin[2]/Math.abs(wpixdim[2])],
+ wpixdim: [Math.abs(wpixdim[0]),Math.abs(wpixdim[1]),Math.abs(wpixdim[2])],
+ w2v: me.invMat(v2w),
+ wori: wori
+ };
+ },
+ testS2VTransformation: function testS2VTransformation() {
+ var me=AtlasMakerWidget;
+ var l=me.traceLog(testS2VTransformation);if(l)console.log(l);
+
+ /*
+ check the S2V transformation to see if it looks correct.
+ If it does not, reset it
+ */
+ var mri=me.User; // this line is different from server
+ var doReset=false;
+
+ console.log("Transformation TEST:");
+
+ console.log(" 1. transformation volume");
+ var vv=mri.dim[0]*mri.dim[1]*mri.dim[2];
+ var vs=mri.s2v.sdim[0]*mri.s2v.sdim[1]*mri.s2v.sdim[2];
+ var diff=(vs-vv)/vv;
+ if(Math.abs(diff)>0.001) {
+ console.log(" ERROR: Difference is too large");
+ console.log(" original volume:",vv);
+ console.log(" rotated volume:",vs);
+ console.log(" % difference:",diff*100);
+ doReset=true;
+ } else {
+ console.log(" ok.");
+ }
+
+ console.log(" 2. transformation origin");
+ if( mri.s2v.sori[0]<0||mri.s2v.sori[0]>mri.s2v.sdim[0] ||
+ mri.s2v.sori[1]<0||mri.s2v.sori[1]>mri.s2v.sdim[1] ||
+ mri.s2v.sori[2]<0||mri.s2v.sori[2]>mri.s2v.sdim[2]) {
+ console.log(" Origin point is outside the dimensions of the data");
+ doReset=true;
+ } else {
+ console.log(" ok.");
+ }
+
+ if(doReset) {
+ console.log("THE TRANSFORMATION WILL BE RESET");
+ mri.v2w=[[mri.pixdim[0],0,0],[0,-mri.pixdim[1],0],[0,0,-mri.pixdim[2]]];
+ mri.wori=[0,mri.dim[1],mri.dim[2]];
+
+ // re-compute the transformation from voxel space to screen space
+ me.computeS2VTransformation(); // this line is different from server
+ console.log(mri.dir);
+ console.log(mri.ori);
+ console.log(mri.s2v);
+ }
+ },
+
+ S2I: function S2I(s,mri) {
+ var me=AtlasMakerWidget;
+ var l=me.traceLog(S2I,3);if(l)console.log(l);
+
+ var s2v=mri.s2v;
+ var i=null,w,s,v;
+ w=me.mulMatVec(s2v.s2w,me.subVecVec(s,s2v.sori)); // screen to world: w=s2w*(s-sori)
+ v=me.mulMatVec(s2v.w2v,me.subVecVec(w,mri.wori)); // world to voxel
+ v=[Math.round(v[0]),Math.round(v[1]),Math.round(v[2])]; // round to integer
+ if(v[0]>=0&&v[0]
+
+
+
+
+
+
+
Real-time collaboration
+
group de neuroanatomie appliquée et théorique
@@ -216,7 +216,7 @@ var brainsToTry=[
}
// Add URL loading
$("#url").keyup(function(e) {
- console.log(e,e.target);
+ //console.log(e,e.target);
if (e.keyCode == 13) {
goToURL(e);
}
diff --git a/views/mri.mustache b/views/mri.mustache
index 1de41d1ef35f17092f2f6e1ef204645332ac09d7..b2d4c0a83034abee944e6ad1b78e659120c96463 100644
--- a/views/mri.mustache
+++ b/views/mri.mustache
@@ -51,7 +51,7 @@
-
+
Name
@@ -163,141 +163,150 @@ https://dl.dropboxusercontent.com/u/363467/mprage003.nii.gz
MyLoginWidget.init($("#MyLogin"));
*/
-var params=JSON.parse('{{{params}}}');
-var mriInfo=JSON.parse('{{{mriInfo}}}');
+var params={{{params}}};
+var mriInfo={{{mriInfo}}};
var version=1;
var info_proxy={};
var hash_old;
-params.info=mriInfo;
+if( $.isEmptyObject(mriInfo)) {
+ $("#stereotaxic").prepend("ERROR: Cannot read the data.
",
- " "],function(o){return o}).join(),
- objTemplate: [
- { typeOfBinding:2,
- path:"mri.atlas.#.name"
- },
- { typeOfBinding:2,
- path:"mri.atlas.#.project"
- },
- { typeOfBinding:2,
- path:"mri.atlas.#.labels",
- format: function(e,d){$(e).find("select").prop('selectedIndex',$.map(BrainBox.labelSets,function(o){return o.source}).indexOf(d))},
- /*
- -----------------------------------------------------------
- NOTE: this is a temporary fix, the final version should be:
- -----------------------------------------------------------
- format: function(e,d){$(e).find("select").prop('selectedIndex',$.map(BrainBox.labelSets,function(o){return o.source}).indexOf(d))},
- */
- parse: function(e){var name=$(e).find("select").val(),i=$.map(BrainBox.labelSets,function(o){return o.name}).indexOf(name);return BrainBox.labelSets[i].source}
- },
- { typeOfBinding:1,
- path:"mri.atlas.#.owner",
- format: function(e,d){$.get("/api/user/"+d.split("/").pop()+"?var=nickname",function(r){$(e).text(r);$(e).attr('href',d)})}
- },
- { typeOfBinding:1,
- path:"mri.atlas.#.created",
- format: date_format
- },
- { typeOfBinding:1,
- path:"mri.atlas.#.modified",
- format: date_format
- },
- { typeOfBinding:2,path:"mri.atlas.#.access",
- format: function(e,d){$(e).find("select").prop('selectedIndex',BrainBox.access.indexOf(d))},
- parse: function(e){return $(e).find("select").val()}
- }
- ]
+ var fullscreen=false;
+ if(params.fullscreen)
+ params.fullscreen=(params.fullscreen=="true");
- };
+ // Present a splash screen while loading
+ $("#intro").hide();
+ $("#splash").show();
- // bind interface
- bind2(info_proxy,BrainBox.info,"name",$("#name"));
- bind1(info_proxy,BrainBox.info,"source",$("#source"));
- bind1(info_proxy,BrainBox.info,"included",$("#included"),date_format);
- for(var i=0;i",
- " ",
- " ", // append label sets
- " ",
- " ",
- " ",
- " ", // append label sets
- " ",
+ " ",
+ " ", // append label sets
+ " ",
+ " ",
+ " ",
+ " ", // append label sets
+ ""],function(o){return o}).join(),
+ objTemplate: [
+ { typeOfBinding:2,
+ path:"mri.atlas.#.name"
+ },
+ { typeOfBinding:2,
+ path:"mri.atlas.#.project"
+ },
+ { typeOfBinding:2,
+ path:"mri.atlas.#.labels",
+ format: function(e,d){$(e).find("select").prop('selectedIndex',$.map(BrainBox.labelSets,function(o){return o.source}).indexOf(d))},
+ /*
+ -----------------------------------------------------------
+ NOTE: this is a temporary fix, the final version should be:
+ -----------------------------------------------------------
+ format: function(e,d){$(e).find("select").prop('selectedIndex',$.map(BrainBox.labelSets,function(o){return o.source}).indexOf(d))},
+ */
+ parse: function(e){var name=$(e).find("select").val(),i=$.map(BrainBox.labelSets,function(o){return o.name}).indexOf(name);return BrainBox.labelSets[i].source}
+ },
+ { typeOfBinding:1,
+ path:"mri.atlas.#.owner",
+ format: function(e,d){$.get("/user/json/"+d.split("/").pop()+"?var=nickname",function(r){$(e).text(r);$(e).attr('href',d)})}
+ },
+ { typeOfBinding:1,
+ path:"mri.atlas.#.created",
+ format: date_format
+ },
+ { typeOfBinding:1,
+ path:"mri.atlas.#.modified",
+ format: date_format
+ },
+ { typeOfBinding:2,path:"mri.atlas.#.access",
+ format: function(e,d){$(e).find("select").prop('selectedIndex',BrainBox.access.indexOf(d))},
+ parse: function(e){return $(e).find("select").val()}
+ }
+ ]
- // annotations table: connect pop-down menus
- $(document).on('change', "table#info select", function(){
- var col=$("table#info tr:eq(0) th:eq("+$(this).closest('td')[0].cellIndex+")").text();
- var index=$(this).closest('tr')[0].rowIndex-1;
- switch(col) {
- case "Label Set":
- var url=info_proxy["mri.atlas."+index+".labels"];
- $.getJSON(url,function(json) {
- AtlasMakerWidget.configureOntology(json);
- AtlasMakerWidget.brain_img.img=null; // to force redraw with new colors
- AtlasMakerWidget.drawImages();
- });
- break;
- case "Access":
- break;
- }
- });
+ };
- // annotation table: select row
- $(document).on('click', "#info tr",BrainBox.selectAnnotationTableRow);
-
- // annotations table: add, remove and save annotations
- $(document).on('click', "#addAnnotation", function(){BrainBox.addAnnotation(aParam)});
- $(document).on('click', "#removeAnnotation", function(){BrainBox.removeAnnotation(aParam)});
- $(document).on('click', "#saveAnnotations", function(){BrainBox.saveAnnotations(aParam)});
-
- // annotations table: select the first row by default
- $("table#info tr").removeClass("selected");
- $("table#info tr").eq(1).addClass("selected");
+ // bind interface
+ bind2(info_proxy,BrainBox.info,"name",$("#name"));
+ bind1(info_proxy,BrainBox.info,"source",$("#source"));
+ bind1(info_proxy,BrainBox.info,"included",$("#included"),date_format);
+ for(var i=0;i
@@ -139,10 +183,16 @@ var str;
function loadProjectFile(url) {
var params={url:url,view:"cor",slice:180,fullscreen:false};
- $.get("/api/mri",{url:url})
+ $.get("/mri/json",{url:url})
.done(function from_loadProjectFile(data) {
- params.info=data;
- BrainBox.configureBrainBox(params)
+ if($.isEmptyObject(data) === false) {
+ params.info=data;
+ BrainBox.configureBrainBox(params)
+ } else {
+ var info=AtlasMakerWidget.container.find("#info");
+ info.html("
",
- " "+name+" ",
+ " "+filename+" ",
" ",
" ",
""].join("");
}
$("#projectFiles tbody").append(str);
for(var i=0;i
-
+
+