forked from satra/BrainImagingPipelines
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
194 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
*.pyc | ||
*.py~ | ||
example_configs/* | ||
*.swp | ||
doc/*/generated | ||
doc/_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<!DOCTYPE HTML> | ||
<!-- | ||
/* | ||
* jQuery File Upload Plugin Demo 6.9 | ||
* https://github.com/blueimp/jQuery-File-Upload | ||
* | ||
* Copyright 2010, Sebastian Tschan | ||
* https://blueimp.net | ||
* | ||
* Licensed under the MIT license: | ||
* http://www.opensource.org/licenses/MIT | ||
*/ | ||
--> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>BIPS</title> | ||
<meta name="description" content="BIPS is a Python framework for brain imaging to host reusable, queriable and uniquely identifiable workflows. This demo allows users to upload a structural and a resting state functional image and get back a quality assessment report and a view of their statistics relative to other datasets."> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<!-- Bootstrap CSS Toolkit styles --> | ||
<link rel="stylesheet" href="css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="css/bootstrap-responsive.css"> | ||
<!-- Generic page styles --> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<link href="css/docs.css" rel="stylesheet"> | ||
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> | ||
<link rel="stylesheet" href="css/jquery.fileupload-ui.css"> | ||
<!-- Shim to make HTML5 elements usable in older Internet Explorer versions --> | ||
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | ||
<style type='text/css'> | ||
pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; } | ||
.string { color: green; } | ||
.number { color: darkorange; } | ||
.boolean { color: blue; } | ||
.null { color: magenta; } | ||
.key { color: red; } | ||
|
||
</style> | ||
</head> | ||
|
||
<body data-spy="scroll" data-target=".subnav" data-offset="50"> | ||
|
||
<!-- Navbar | ||
================================================== --> | ||
<div class="navbar navbar-fixed-top"> | ||
<div class="navbar-inner"> | ||
<div class="container"> | ||
<button type="button"class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="brand" href="./">BIPS</a> | ||
<div class="nav-collapse"> | ||
<ul class="nav"> | ||
<li class=""><a href="./index">Overview</a></li> | ||
<li class="active"><a href="./workflows">Workflows</a></li> | ||
<li class=""><a href="./database">Database</a></li> | ||
<li class=""><a href="./publications">Publications</a></li> | ||
<li class=""><a href="./neuroview">Neuroview</a></li> | ||
<li class=""><a href="./links">Links</a></li> | ||
<li class="divider-vertical"></li> | ||
<li class=""><a href="./demo">Demo</a></li> | ||
<li class=""><a href="./status">Status</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container"> | ||
|
||
<div class="row"> | ||
**TEMPLATE** | ||
</div> | ||
|
||
<!-- Footer | ||
================================================== --> | ||
<footer class="footer"> | ||
<p class="pull-right"><a href="#">Back to top</a></p> | ||
<p>Brewed at <a href="http://gablab.mit.edu" target="_blank">Gablab@MIT</a> and TankThink Labs LLC. Supported by <a href="http://incf.org>" target="_blank">INCF</a>.</p> | ||
<p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>. Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p> | ||
<p>Icons from <a href="http://glyphicons.com">Glyphicons Free</a>, licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p> | ||
</footer> | ||
|
||
</div><!-- /container --> | ||
|
||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | ||
<script src="js/bootstrap.js"></script> | ||
<script src="js/bootstrap-typeahead.js"></script> | ||
<script src="js/bootstrap-modal.js"></script> | ||
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ --> | ||
<!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import colander | ||
from colander import Schema | ||
from deform import Form | ||
import deform | ||
import traits.api as traits | ||
|
||
class Schema(colander.MappingSchema): | ||
pass | ||
|
||
def getNode(_type,tr,config): | ||
if _type == type(traits.Int()): | ||
col_type = colander.SchemaNode(colander.Int(), | ||
name=tr,description=config.trait(tr).desc) | ||
elif _type == type(traits.Float()): | ||
col_type = colander.SchemaNode(colander.Decimal(),name=tr) | ||
|
||
elif _type == type(traits.String()) or _type==type(traits.Str()): | ||
col_type = colander.SchemaNode(colander.String(),name=tr) | ||
|
||
elif _type == type(traits.Enum('')): | ||
values=config.trait(tr).trait_type.values | ||
the_values = [] | ||
for v in values: | ||
the_values.append((v,v)) | ||
col_type = colander.SchemaNode( | ||
deform.Set(), | ||
widget=deform.widget.SelectWidget(values=the_values), | ||
name=tr) | ||
elif _type == type(traits.Bool()): | ||
col_type = colander.SchemaNode(colander.Boolean(),widget=deform.widget.CheckboxWidget(),name=tr) | ||
elif _type == type(traits.Code()): | ||
col_type = colander.SchemaNode(colander.String(),name=tr,widget=deform.widget.TextAreaWidget(cols=100,rows=20)) | ||
#elif _type == type(traits.Instance()) | ||
elif _type == type(traits.List()): | ||
col_type =get_list(_type,tr,config) | ||
else: | ||
print "type: ", _type, "not found!" | ||
col_type = colander.SchemaNode(colander.String(),name=tr) | ||
return col_type | ||
|
||
def get_form(config): | ||
schema = colander.Schema() | ||
all_traits = config.trait_names() | ||
all_traits.remove('trait_added') | ||
all_traits.remove('trait_modified') | ||
|
||
for tr in all_traits: | ||
_type = type(config.trait(tr).trait_type) | ||
|
||
col_type = getNode(_type,tr,config) | ||
|
||
schema.add(col_type) | ||
|
||
form = Form(schema,buttons = ('submit',),action='') | ||
|
||
return form.render(appstruct=config.get()) | ||
|
||
def validator(form,value): | ||
pass | ||
|
||
def get_list(thetype,tr,config): | ||
col_type = colander.SchemaNode(colander.String(), | ||
name=tr, | ||
description=config.trait(tr).desc, | ||
widget=deform.widget.TextInputCSVWidget(cols=100,rows=1)) | ||
return col_type | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters