Skip to content

Commit

Permalink
Add support for viewing experiment level resources with the filelist …
Browse files Browse the repository at this point in the history
…filtered by JSON stored in the config service
  • Loading branch information
hodgem committed Jun 26, 2015
1 parent 5cd6ba4 commit 47b10f2
Show file tree
Hide file tree
Showing 14 changed files with 1,690 additions and 1,282 deletions.
22 changes: 21 additions & 1 deletion src/main/scripts/viewer/gxnat/ProjectTree.js
Expand Up @@ -409,6 +409,7 @@ function(endNodeObj, opt_onNodeAdded, opt_onDone) {
opt_onNodeAdded(projNode);
}
this.loadBranch(endNodePath, opt_onNodeAdded, opt_onDone);
this.loadProjectResourceFilters();
}.bind(this))
return;
}
Expand Down Expand Up @@ -478,6 +479,24 @@ function(endNodeObj, opt_onNodeAdded, opt_onDone) {
}


/**
* @public
*/
gxnat.ProjectTree.prototype.loadProjectResourceFilters = function() {

//
// Load experiment resource filter object for this project from configuration service
//
// Example stored JSON:
// "{\"/Structural_preproc/\": [ \"/^.*\\\\/T1w\\\\/[^\\\\/]*\\\\/mri\\\\/[^\\\\/]*/\", \"/^.*\\\\/T1w\\\\/[^\\\\/]*\\\\/mri\\\\/transforms\\\\/[^\\\\/]*/\" ], \"/^.*_unproc/\": [ \"/.*/\" ] }"
//
var exptResourceUri = this.Proj_[gxnat.ProjectTree.PATH_KEY]['originalUrl'] + '/config/experimentResources/filters?contents=true';
gxnat.get(exptResourceUri, function(filterJSON){
this.Proj_['experimentResourceFilters']=filterJSON;
}.bind(this),'json');

}


/**
* @param {!gxnat.Path | !string} projPath The subject path to start the load
Expand Down Expand Up @@ -515,6 +534,7 @@ gxnat.ProjectTree.prototype.loadProject = function(callback) {
//
this['projects'].push(node);
this.Proj_ = node;
projNode = node;

//
// Store the node as part of the tree
Expand All @@ -534,6 +554,7 @@ gxnat.ProjectTree.prototype.loadProject = function(callback) {
//
callback(node);
}.bind(this), '&ID=' + this.initPath_['projects'] + colStr)

}


Expand Down Expand Up @@ -651,7 +672,6 @@ function(opt_onNodeAdded, opt_onDone) {

window.console.log('load subjects', subjectsUri, subjUriSuffix);


//
// Query for the subjects within the project
//
Expand Down
3 changes: 2 additions & 1 deletion src/main/scripts/viewer/gxnat/gxnat-deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/main/scripts/viewer/gxnat/vis/AjaxViewableTree.js
Expand Up @@ -43,9 +43,9 @@ function(category, opt_viewableJson, opt_experimentUrl) {

this.experimentUrl = opt_experimentUrl;

this.queryUrl = gxnat.Path.graftUrl(this.experimentUrl,
this.queryUrl = (category!="ExperimentResources") ? gxnat.Path.graftUrl(this.experimentUrl,
opt_viewableJson['URI'],
'experiments');
'experiments') : this.experimentUrl + "/resources/" + opt_viewableJson['xnat_abstractresource_id'];

this.Path = new gxnat.Path(this.queryUrl);
}
Expand Down

0 comments on commit 47b10f2

Please sign in to comment.