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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41, Wed Mar 3 17:38:27 2010 UTC revision 149, Fri Jul 9 08:34:57 2010 UTC
# Line 1  Line 1 
1  // vr.diderot  // vr-MIP.diderot
2  //  //
3  // maximum intensity projection in Diderot  // maximum intensity projection in Diderot
4  //  //
5    
6  input string dataFile;          // name of dataset  input string dataFile;          // name of dataset
7  input real stepSz;              // size of steps  input real stepSz;              // size of steps
8  input vec<3> light;                              // e.g. 0.1
9  input int wid = 640;  input vec3 eye;             // location of eye point
10  input int ht = 480;                              // e.g. (25,15,10)
11    input vec3 orig;            // location of pixel (0,0)
12                                // e.g. (12.1373,4.78258,8.3972)
13    input vec3 cVec;            // vector between pixels horizontally
14                                // e.g. (-0.0135258,0.0247972,0)
15    input vec3 rVec;            // vector between pixels vertically
16                                // e.g. (0.00667124,0.00363886,-0.0272048)
17    
18  image[3] img = load (dataFile);  image(3)[] img = load (dataFile);
19    
20  field#1[3] F = convolve (bspln3, img);  //field#1(3)[] F = convolve (bspln3, img);
21    field#2(3)[] F = convolve (bspln3, img);
22    
23  actor RayCast (int row, int col)  actor RayCast (int row, int col)
24  {  {
25      vec<3>      dir = (real(row), real(col), 0.0);      vec3 pos = orig + real(row)*rVec + real(col)*cVec;
26      vec<3>      pos = (0.0, 0.0, 0.0);      vec3 dir = (pos - eye)/|pos - eye|;
27      real        t = 0.0;      real        t = 0.0;
28      real        maxval = -inf;      real        maxval = -inf;
     int         num = 0;  
29    
30      update      update
31      {      {
32          vec<3> pt = pos + t*dir;          vec3 pt = pos + t*dir;
33          real val = F@pt;          real val = F@pt;
34          maxval = max(val, maxval);          maxval = max(val, maxval);
35          if (t > 1)          if (t > 20)
36              stabilize;              stabilize;
37          t = t + stepSz;          t = t + stepSz;
         num = num + 1;  
38      }      }
39    
40      /* render: output maxval */      /* render: output maxval */
41  }  }
42    
43    initially [ RayCast(r, c) | r in 0..199, c in 0..199 ];

Legend:
Removed from v.41  
changed lines
  Added in v.149

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0