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.diderot
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 206 - (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 :     // e.g. (25,15,10)
11 :     input vec3 orig; // location of pixel (0,0)
12 : glk 206 // e.g. txs: (8.83877,2.5911,7.65275)
13 :     // e.g. vox1: (7.45013,2.9202,5.53883)
14 : jhr 178 input vec3 cVec; // vector between pixels horizontally
15 : glk 206 // e.g. txs: (-0.0151831,0.0278357,0)
16 :     // e.g. vox1: (-0.00930055,0.0164548,0)
17 : jhr 178 input vec3 rVec; // vector between pixels vertically
18 : glk 206 // e.g. txs: (0.0074887,0.00408474,-0.0305383)
19 :     // e.g. vox1: (0.00476876,0.00269539,-0.0180902)
20 : glk 41
21 : jhr 142 image(3)[] img = load (dataFile);
22 : glk 41
23 : jhr 142 //field#1(3)[] F = convolve (bspln3, img);
24 :     field#2(3)[] F = convolve (bspln3, img);
25 :    
26 : glk 41 actor RayCast (int row, int col)
27 :     {
28 : glk 145 vec3 pos = orig + real(row)*rVec + real(col)*cVec;
29 :     vec3 dir = (pos - eye)/|pos - eye|;
30 :     real t = 0.0;
31 : jhr 163 output real maxval = -inf;
32 : glk 41
33 :     update
34 :     {
35 : jhr 163 pos = pos + stepSz*dir;
36 : jhr 178 if (inside (pos,F)) {
37 :     real val = F@pos;
38 :     maxval = max(val, maxval);
39 :     }
40 : jhr 163 if (t > 20.0)
41 : glk 145 stabilize;
42 :     t = t + stepSz;
43 : glk 41 }
44 :    
45 :     /* render: output maxval */
46 :     }
47 : jhr 142
48 : 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