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

SCM Repository

[diderot] Annotation of /branches/fem/test/vr-MIP-test.diderot
ViewVC logotype

Annotation of /branches/fem/test/vr-MIP-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3210 - (view) (download)

1 : jhr 1115 // vr-MIP-test.diderot
2 :     //
3 :     // test version of maximum intensity projection in Diderot
4 :     //
5 :    
6 :     //string dataFile = "../data/txs.nrrd";
7 :     //vec3 eye = [25.0, 15.0, 10.0];
8 :     //vec3 orig = [8.83877,2.5911,7.65275];
9 :     //vec3 cVec = [-0.0151831,0.0278357,0.0];
10 :     //vec3 rVec = [0.0074887,0.00408474,-0.0305383];
11 :     vec3 eye = [127.331,-1322.05,272.53];
12 :     vec3 orig = [122.835,17.7112,188.044];
13 :     vec3 cVec = [-0.00403611,-0.029826,-0.244066];
14 :     vec3 rVec = [-0.245595,-0.0112916,0.00544129];
15 :    
16 :     real stepSz = 0.5;
17 : jhr 1927 image(3)[] img = load ("../data/vfrhand-nohip.nhdr");
18 : jhr 1115 field#2(3)[] F = img ⊛ bspln3;
19 :     //field#0(3)[] F = img ⊛ tent;
20 :    
21 :     strand RayCast (int row, int col)
22 :     {
23 :     int r = row; // for debugging
24 :     int c = col; // for debugging
25 :     vec3 pos = orig + real(row)*rVec + real(col)*cVec;
26 :     vec3 dir = normalize(pos - eye);
27 :     real t = 0.0;
28 :     output real maxval = -∞;
29 :    
30 :     update
31 :     {
32 :     pos = pos + stepSz*dir;
33 :     if (inside (pos,F)) {
34 :     real val = F@pos;
35 :     maxval = max(val, maxval);
36 :     }
37 :     if (t > 80.0)
38 :     stabilize;
39 :     t = t + stepSz;
40 :     }
41 :    
42 :     /* render: output maxval */
43 :     }
44 :    
45 :     initially [ RayCast(r, c) | r in 0..479, c in 0..639 ];

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