/
index.html
184 lines (153 loc) · 7.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<html>
<!-- Nifti File Reader
@vsoch, Poldracklab <3
Nifti Learning: @scijs https://github.com/scijs/nifti-js
@papaya viewer https://github.com/rii-mango/Papaya
standard: http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
File Reader Learning: http://www.html5rocks.com/en/tutorials/file/dndfiles/
-->
<head>
<title>nifti-nidm drop</title>
<script src="js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script src="js/bootstrap.min.js"></script>
<script src="js/d3.min.js"></script>
<link href="css/fresh-bootstrap-table.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://rawgithub.com/vsoch/font-brain/master/font-brain/font-brain.css" rel="stylesheet">
<script src="js/pako-inflate.js"></script>
<script src="js/volume.js"></script>
<script src="js/table.js"></script>
<link rel="stylesheet" type="text/css" href="css/papaya.css" /> <!--version=0.8&build=910-->
<script type="text/javascript" src="js/papaya.js"></script> <!--version=0.8&build=910,beta-->
</head>
<body>
<div class="row">
<!-- Left sidebar region for tables -->
<div id="bluetable" class="col-md-3">
<!-- Drop zone -->
<div class="row">
<div id="drop_zone">Drop nii/nidm here</div>
<div id="error"></div>
</div>
<!-- Tables for either nifti or nidm will be dynamically rendered here -->
<div class="row" id="tablerow">
</div>
</div>
<!-- Papaya viewer window -->
<div id="pappy" class="col-md-9">
<div class="row">
<!-- Buttons! -->
<div id="button_zone">
<div class="float-right-wrapper">
<a href="data/nidm.ttl" target="_blank">
<button class="btn btn-default circle" style="padding: 2px 5px 2px 5px"><i class="fb fb-2x icon-nidm"></i></button>
</a>
<a href="data/motor_lips.nii" target="_blank">
<button class="btn btn-default circle"><i class="fb icon-sagittal"></i></button>
</a>
<a href="https://www.github.com/vsoch/nifti-drop" target="_blank">
<button class="btn btn-default circle"><i class="fa fa-github"></i></button>
</a>
</div>
</div>
<script type="text/javascript">
var cx;
var params = [];
params["worldSpace"] = true;
params["expandable"] = false;
params["combineParametric"] = true;
params["showControls"] = false;
params["luts"] = [{"name":"PuBu", "data":[[0,1,0.968627,0.984314],[0.125,0.92549,0.905882,0.94902],[0.25,0.815686,0.819608,0.901961],[0.375,0.65098,0.741176,0.858824],[0.5,0.454902,0.662745,0.811765],[0.625,0.211765,0.564706,0.752941],[0.75,0.0196078,0.439216,0.690196],[0.875,0.0156863,0.352941,0.552941],[1,0.00784314,0.219608,0.345098]]},
{"name":"OrRd", "data":[[0,1,0.968627,0.92549],[0.125,0.996078,0.909804,0.784314],[0.25,0.992157,0.831373,0.619608],[0.375,0.992157,0.733333,0.517647],[0.5,0.988235,0.552941,0.34902],[0.625,0.937255,0.396078,0.282353],[0.75,0.843137,0.188235,0.121569],[0.875,0.701961,0,0],[1,0.498039,0,0]]}];
params["images"] = ["img/MNI152_T1_2mm_brain.nii.gz"];
params["img/MNI152_T1_2mm_brain.nii.gz"] = {"parametric": true, "lut":"Spectrum", "min":0, "alpha":"0.75"};
params["kioskMode"] = true;
// Function to add / remove image from viewer
function viewimage(file,filetype) {
filetype = typeof filetype !== 'undefined' ? filetype : "local";
// Tag canvas, and show export button
$($("canvas")[0]).attr("id","papaya-canvas")
$("#export").show()
params[file.name] = {"parametric": true, "lut":"Spectrum", "min":0, "alpha":"0.75"};
// Reset viewer and load new images
papayaContainers[0].viewer.resetViewer(0,params);
papayaContainers[0].toolbar.updateImageButtons();
papayaContainers[0].viewer.loadBaseImage(["img/MNI152_T1_2mm_brain.nii.gz"],true)
// This is not ideal, but a workaround for now
setTimeout(function(){
if (filetype == "url") {
papayaContainers[0].viewer.loadOverlay([file],true);
} else {
papayaContainers[0].viewer.loadOverlay([file],false,false);
}
}, 500);
}
</script>
<div class="papaya" data-params="params" style="background-color:black"></div>
<!-- View svg modal -->
<div class="modal" id="exportmodal">
<div class="modal-admin">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Right click to Save As</h4>
</div>
<div class="modal-body">
<div id="svgexport"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</body>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap-table.js"></script>
<script type="text/javascript">
$().ready(function(){
nifti_table();
});
function operateFormatter(value, row, index) {
return [
//'<a rel="tooltip" title="Like" class="table-action like" href="javascript:void(0)" title="Like">',
// '<i class="fa fa-heart"></i>',
//'</a>',
//'<a rel="tooltip" title="Edit" class="table-action edit" href="javascript:void(0)" title="Edit">',
// '<i class="fa fa-edit"></i>',
//'</a>',
'<a rel="tooltip" title="Remove" class="table-action remove" href="javascript:void(0)" title="Remove">',
'<i class="fa fa-remove"></i>',
'</a>'
].join('');
}
</script>
</div>
</div>
<!-- Hidden form for file select, if given from url -->
<form action="" method="GET" class="hidden">
<input id="urlbutton" type="button" value="process file" name="submit" style="width:200px;height:20px;" onclick="processUrl(this.form.url.value);">
<input id="url" type="url" name="url" style="width:600px;height:20px;" value="">
</form>
</body>
<script>
$(function () {
$.getScript('js/scribl.min.js'); // for canvas export
$.getScript('js/rdf_store_min.js');
$.getScript('js/nidm.js');
$.getScript('js/nifti.js');
$.getScript('js/script.js');
$(".search").css("width","160px")
$('button[name=toggle]').css("height","40px")
$("td").remove() // remove the fugly
$("#export").hide()
});
</script>
<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
<link href='css/style.css' rel='stylesheet' type='text/css'>