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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 511 - (view) (download)
Original Path: trunk/test/vr-MIP.diderot

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