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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1934 - (view) (download)

1 : jhr 142 // vr-MIP.diderot
2 : glk 41 //
3 :     // maximum intensity projection in Diderot
4 :     //
5 :    
6 : jhr 178 input real stepSz = 0.1; // size of steps
7 :     // e.g. 0.1
8 :     input vec3 eye; // location of eye point
9 : glk 214 // e.g. txs: (25,15,10)
10 : glk 311 // vox1,x: (-8,2,2)
11 :     // vox1,y: (2,-8,2)
12 :     // vox1,z: (2,2,-8)
13 :     // vfrhand: (127.331,-1322.05,272.53)
14 : jhr 178 input vec3 orig; // location of pixel (0,0)
15 : glk 206 // e.g. txs: (8.83877,2.5911,7.65275)
16 : glk 311 // vox1,x: (0,3.4036,3.4036)
17 :     // vox1,y: (0.596402,0,3.4036)
18 :     // vox1,z: (3.4036,3.4036,0)
19 :     // vfrhand: (122.835,17.7112,188.044)
20 : jhr 178 input vec3 cVec; // vector between pixels horizontally
21 : glk 206 // e.g. txs: (-0.0151831,0.0278357,0)
22 : glk 311 // vox1,x: (0,-0.014036,0)
23 :     // vox1,y: (0.014036,0,0)
24 :     // vox1,z: (-0.014036,0,0)
25 :     // vfrhand: (-0.00403611,-0.029826,-0.244066)
26 : jhr 178 input vec3 rVec; // vector between pixels vertically
27 : glk 206 // e.g. txs: (0.0074887,0.00408474,-0.0305383)
28 : glk 311 // vox1,x: (0,0,-0.014036)
29 :     // vox1,y: (0,0,-0.014036)
30 :     // vox1,z: (0,-0.014036,0)
31 :     // vfrhand: (-0.245595,-0.0112916,0.00544129)
32 : glk 41
33 : jhr 1934 input image(3)[] img = load (dataFile);
34 : glk 41
35 : jhr 142 //field#1(3)[] F = convolve (bspln3, img);
36 : jhr 247 field#2(3)[] F = img ⊛ bspln3;
37 : jhr 142
38 : jhr 511 strand RayCast (int row, int col)
39 : glk 41 {
40 : glk 145 vec3 pos = orig + real(row)*rVec + real(col)*cVec;
41 : jhr 1116 vec3 dir = normalize(pos - eye);
42 : glk 145 real t = 0.0;
43 : jhr 249 output real maxval = -∞;
44 : glk 41
45 :     update
46 :     {
47 : jhr 163 pos = pos + stepSz*dir;
48 : jhr 178 if (inside (pos,F)) {
49 :     real val = F@pos;
50 :     maxval = max(val, maxval);
51 :     }
52 : jhr 163 if (t > 20.0)
53 : glk 145 stabilize;
54 :     t = t + stepSz;
55 : glk 41 }
56 :    
57 :     /* render: output maxval */
58 :     }
59 : jhr 142
60 : glk 145 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