Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/ifbug.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/ifbug.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 667 - (view) (download)

1 : glk 666
2 :     input string dataFile = "../data/txs.nrrd";
3 :     real stepSz = 0.2;
4 :     vec3 eye = [25.0, 15.0, 10.0];
5 :     vec3 orig = [8.83877,2.5911,7.65275];
6 :     vec3 cVec = [-0.0151831,0.0278357,0.0];
7 :     vec3 rVec = [0.0074887,0.00408474,-0.0305383];
8 :    
9 :     image(3)[] img = load (dataFile);
10 :    
11 :     field#2(3)[] F = img ⊛ bspln3;
12 :    
13 :     strand RayCast (int row, int col)
14 :     {
15 :     vec3 pos = orig + real(row)*rVec + real(col)*cVec;
16 :     vec3 dir = (pos - eye)/|pos - eye|;
17 :     real t = 0.0;
18 :     real transp = 1.0;
19 :     output real gray = 0.0;
20 :    
21 :     update
22 :     {
23 :     pos = pos + stepSz*dir;
24 :     if (inside (pos,F)) {
25 :     real val = F@pos;
26 :     gray = gray + val;
27 :     }
28 :     if (t > 20.0) {
29 :     stabilize;
30 :     }
31 : glk 667 // HEY: this branch should never matter, since the value of
32 :     // transp is never changed from 1.0. However, commenting
33 :     // it out will result in a different result image
34 : glk 666 if (transp < 0.01) {
35 :     transp = 0.0;
36 :     stabilize;
37 :     }
38 :     t = t + stepSz;
39 :     }
40 :     }
41 :    
42 :     initially [ RayCast(r, c) | r in 0..199, c in 0..199 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0