Skip to content

Commit b27ccce

Browse files
Mei-Hui SuMei-Hui Su
authored andcommitted
1) commit a version to be tagged with debug statements
1 parent 7c69fa4 commit b27ccce

File tree

10 files changed

+426
-406
lines changed

10 files changed

+426
-406
lines changed

3mesh_tiny.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

3vol.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
<head>
55
<script type='text/javascript' src='js/jquery.js'></script>
66
<script type='text/javascript' src='js/jquery.ui.js'></script>
7-
<script type="text/javascript" src="js/xtk.js"></script>
7+
8+
<script type="text/javascript" src="x-meihuisu/lib/google-closure-library/closure/goog/base.js"></script>
9+
<script type="text/javascript" src="x-meihuisu/xtk-deps.js"></script>
10+
<script type="text/javascript" src="js/default.js"></script>
11+
812
<script type="text/javascript" src="js/3vol.js"></script>
913
</head>
1014
<body>
11-
<div id='3vol' style='background-color:grey; float: left; width:900px; height:4
12-
00px; margin: 10px;'></div>
15+
<div id='3vol' style='background-color:grey; float: left; width:600px; height:600px; margin: 10px;'></div>
1316
</body>
1417
</html>
1518

3vol_tiny.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

css/jquery.sidebar.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
height: 150px;
9898
background-color: #000;
9999
opacity: 0.8;
100-
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80 );
101100
}
102101

103102
.menuDisabled {

js/3vol.js

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,61 @@ window.onload = function() {
66

77
// create a X.volume
88
var volume = new X.volume();
9-
volume.file = "http://localhost/data/tissue.nii"
9+
//volume.file = "http://localhost/data/bone.nii"
10+
volume.file = "http://localhost/data/mAN261_Cor_60.nii"
1011
//volume.file = "https://cirm-dev.misd.isi.edu/data/tissue.nii"
1112

13+
r.add(volume);
14+
15+
r.onShowtime = function() {
16+
// CREATE Bounding Box
17+
var res = [volume.bbox[0],volume.bbox[2],volume.bbox[4]];
18+
var res2 = [volume.bbox[1],volume.bbox[3],volume.bbox[5]];
19+
20+
box = new X.object();
21+
box.points = new X.triplets(72);
22+
box.normals = new X.triplets(72);
23+
box.type = 'LINES';
24+
box.points.add(res2[0], res[1], res2[2]);
25+
box.points.add(res[0], res[1], res2[2]);
26+
box.points.add(res2[0], res2[1], res2[2]);
27+
box.points.add(res[0], res2[1], res2[2]);
28+
box.points.add(res2[0], res[1], res[2]);
29+
box.points.add(res[0], res[1], res[2]);
30+
box.points.add(res2[0], res2[1], res[2]);
31+
box.points.add(res[0], res2[1], res[2]);
32+
box.points.add(res2[0], res[1], res2[2]);
33+
box.points.add(res2[0], res[1], res[2]);
34+
box.points.add(res[0], res[1], res2[2]);
35+
box.points.add(res[0], res[1], res[2]);
36+
box.points.add(res2[0], res2[1], res2[2]);
37+
box.points.add(res2[0], res2[1], res[2]);
38+
box.points.add(res[0], res2[1], res2[2]);
39+
box.points.add(res[0], res2[1], res[2]);
40+
box.points.add(res2[0], res2[1], res2[2]);
41+
box.points.add(res2[0], res[1], res2[2]);
42+
box.points.add(res[0], res2[1], res2[2]);
43+
box.points.add(res[0], res[1], res2[2]);
44+
box.points.add(res[0], res2[1], res[2]);
45+
box.points.add(res[0], res[1], res[2]);
46+
box.points.add(res2[0], res2[1], res[2]);
47+
box.points.add(res2[0], res[1], res[2]);
48+
for ( var i = 0; i < 24; ++i) {
49+
box.normals.add(0, 0, 0);
50+
}
51+
r.add(box);
52+
53+
var center = [volume.bbox[0] + (volume.bbox[1]-volume.bbox[0]),
54+
volume.bbox[2] + (volume.bbox[3]-volume.bbox[2]),
55+
volume.bbox[4] + (volume.bbox[5]-volume.bbox[4])
56+
]
57+
58+
}
59+
1260
var _camera=r.camera;
1361
console.log("orig, camera position is.."+_camera.position);
14-
r.camera.position = [0,-300,0];
15-
r.add(volume);
16-
console.log("new, camera position is.."+_camera.position);
17-
r.render();
62+
63+
r.render();
64+
1865
}
1966

js/x.rendering.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function initializeRenderers(){
136136
ren3d.onShowtime = function() {
137137

138138
window.console.log('Loading completed.');
139+
window.console.time('ShowTime');
139140

140141
if (_data.volume.file.length > 0) {
141142

@@ -152,11 +153,11 @@ function initializeRenderers(){
152153

153154
//ren3d.resetBoundingBox();
154155

155-
window.console.timeEnd('Loadtime');
156-
157156
setupUi();
158157
configurator();
159158

159+
window.console.timeEnd('ShowTime');
160+
160161
};
161162

162163

@@ -448,14 +449,17 @@ window.console.log('Using data url: ' + _file);
448449
}
449450
var http_request= new XMLHttpRequest();
450451
http_request.onreadystatechange = function() {
452+
window.console.log('readyState '+ this.readyState +' status '+this.status);
451453
if (this.readyState == 4 && this.status == 200) {
452454
window.console.timeEnd('httpRequestTime');
453455
var remote_data=http_request.response;
454456
_data[v]['filedata'][_data[v]['file'].indexOf(u)] = remote_data;
455457
_numberRead++;
456458
window.console.log(" >>REMOTE<<, _data index is at ->" + _data[v]['file'].indexOf(u));
457459
if (_numberRead == _numberOfFiles) {
460+
window.console.time('parseRemoteTime');
458461
parse(_data);
462+
window.console.timeEnd('parseRemoteTime');
459463
}
460464
}
461465
}
@@ -478,8 +482,6 @@ function parse(data) {
478482
// initialize renderers
479483
initializeRenderers();
480484

481-
window.console.time('Loadtime');
482-
483485
// check for special case if a volume, a labelmap and a colortable was dropped
484486
if (data['volume']['file'].length == 2 && data['colortable']['file'].length == 1) {
485487

0 commit comments

Comments
 (0)