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