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

SCM Repository

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

Annotation of /trunk/test/vr-MIP.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 163 - (view) (download)

1 : jhr 142 // vr-MIP.diderot
2 : glk 41 //
3 :     // maximum intensity projection in Diderot
4 :     //
5 :    
6 : glk 145 input string dataFile; // name of dataset
7 :     input real stepSz; // size of steps
8 : glk 149 // e.g. 0.1
9 : glk 145 input vec3 eye; // location of eye point
10 : glk 149 // e.g. (25,15,10)
11 : glk 145 input vec3 orig; // location of pixel (0,0)
12 : glk 151 // e.g. (8.83877,2.5911,7.65275)
13 : glk 145 input vec3 cVec; // vector between pixels horizontally
14 : glk 151 // e.g. (-0.0151831,0.0278357,0)
15 : glk 145 input vec3 rVec; // vector between pixels vertically
16 : glk 151 // 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 :     real val = F@pos;
34 : glk 41 maxval = max(val, maxval);
35 : jhr 163 if (t > 20.0)
36 : glk 145 stabilize;
37 :     t = t + stepSz;
38 : glk 41 }
39 :    
40 :     /* render: output maxval */
41 :     }
42 : jhr 142
43 : 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