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

SCM Repository

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

Annotation of /branches/pure-cfg/test/vr-MIP-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 776 - (view) (download)

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