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

SCM Repository

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

Diff of /branches/charisee/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 142, Thu Jul 8 19:12:02 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;  input vec3 eye;                 // location of eye point
9  input int wid = 640;  input vec3 orig;                // location of pixel (0,0)
10  input int ht = 480;  input vec3 cVec;                // vector between pixels horizontally
11    input vec3 rVec;                // vector between pixels vertically
12    
13  image[3] img = load (dataFile);  image(3)[] img = load (dataFile);
14    
15  field#1[3] F = convolve (bspln3, img);  //field#1(3)[] F = convolve (bspln3, img);
16    field#2(3)[] F = convolve (bspln3, img);
17    
18  actor RayCast (int row, int col)  actor RayCast (int row, int col)
19  {  {
20      vec<3>      dir = (real(row), real(col), 0.0);      vec3        pos = orig + real(row)*rVec + real(col)*cVec;
21      vec<3>      pos = (0.0, 0.0, 0.0);      vec3        dir = (pos - eye)/|pos - eye|;
22      real        t = 0.0;      real        t = 0.0;
23      real        maxval = -inf;      real        maxval = -inf;
24      int         num = 0;      int         num = 0;
25    
26      update      update
27      {      {
28          vec<3> pt = pos + t*dir;          vec3 pt = pos + t*dir;
29          real val = F@pt;          real val = F@pt;
30          maxval = max(val, maxval);          maxval = max(val, maxval);
31          if (t > 1)          if (t > 1.0)
32              stabilize;              stabilize;
33          t = t + stepSz;          t = t + stepSz;
34          num = num + 1;          num = num + 1;
# Line 34  Line 36 
36    
37      /* render: output maxval */      /* render: output maxval */
38  }  }
39    
40    initially [ RayCast(r, c) | r in 0..1023, c in 0..1023 ];

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

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