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 214 - (view) (download)

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 :     // vox1,x: (-8,2,2)
12 :     // vox1,y: (2,-8,2)
13 :     // vox1,z: (2,2-8)
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 214 // vox1,x: (0,3.4036,3.4036)
17 :     // vox1,y: (0.596402,0,3.4036)
18 :     // vox1,z: (3.4036,3.4036,0)
19 : jhr 178 input vec3 cVec; // vector between pixels horizontally
20 : glk 206 // e.g. txs: (-0.0151831,0.0278357,0)
21 : glk 214 // vox1,x: (0,-0.014036,0)
22 :     // vox1,y: (0.014036,0,0)
23 :     // vox1,z: (-0.014036,0,0)
24 : jhr 178 input vec3 rVec; // vector between pixels vertically
25 : glk 206 // e.g. txs: (0.0074887,0.00408474,-0.0305383)
26 : glk 214 // vox1,x: (0,0,-0.014036)
27 :     // vox1,y: (0,0,-0.014036)
28 :     // vox1,z: (0,-0.014036,0)
29 : glk 41
30 : jhr 142 image(3)[] img = load (dataFile);
31 : glk 41
32 : jhr 142 //field#1(3)[] F = convolve (bspln3, img);
33 :     field#2(3)[] F = convolve (bspln3, img);
34 :    
35 : glk 41 actor RayCast (int row, int col)
36 :     {
37 : glk 145 vec3 pos = orig + real(row)*rVec + real(col)*cVec;
38 :     vec3 dir = (pos - eye)/|pos - eye|;
39 :     real t = 0.0;
40 : jhr 163 output real maxval = -inf;
41 : glk 41
42 :     update
43 :     {
44 : jhr 163 pos = pos + stepSz*dir;
45 : jhr 178 if (inside (pos,F)) {
46 :     real val = F@pos;
47 :     maxval = max(val, maxval);
48 :     }
49 : jhr 163 if (t > 20.0)
50 : glk 145 stabilize;
51 :     t = t + stepSz;
52 : glk 41 }
53 :    
54 :     /* render: output maxval */
55 :     }
56 : jhr 142
57 : 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