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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/zslice1.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/zslice1.diderot

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

revision 595, Fri Mar 11 05:36:30 2011 UTC revision 770, Thu Apr 7 20:42:13 2011 UTC
# Line 1  Line 1 
1  // vr-MIP-test.diderot  // zslice1.diderot
 //  
 // test version of maximum intensity projection in Diderot  
 //  
2    
3  string dataFile = "../data/zimg.nrrd";  string dataFile = "../data/zimg.nrrd";
4  int dataSize = 9;  int dataSize = 9;
5  int imgSize = 150; // HEY why doesn't this change size away fom 200x200?  int imgSize = 200;
6  vec3 orig = [0.0, 0.0, 4.0];  vec3 orig = [0.0, 0.0, 4.0];
7  vec3 cVec = [0.0, 1.0, 0.0];  vec3 cVec = [0.0, 1.0, 0.0];
8  vec3 rVec = [1.0, 0.0, 0.0];  vec3 rVec = [1.0, 0.0, 0.0];
# Line 14  Line 11 
11    
12  strand RayCast (int row, int col)  strand RayCast (int row, int col)
13  {  {
14      real rr = real(dataSize)*(real(row)+0.5)/real(imgSize) - 0.5;      real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
15      real cc = real(dataSize)*(real(col)+0.5)/real(imgSize) - 0.5;      real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
16      vec3 pos = orig + rr*rVec + cc*cVec;      vec3 pos = orig + rr*rVec + cc*cVec;
17      output real maxval = -∞;      output real val = -∞;
18    
19      update      update
20      {      {
        // HEY region for this should be exactly centered in the image  
21          if (inside (pos,F)) {          if (inside (pos,F)) {
22            maxval = rr;            val = 1.0;
23          }          }
         if (1 > 0)  
24            stabilize;            stabilize;
25      }      }
   
     /* render: output maxval */  
26  }  }
27    
28  initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];  initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];

Legend:
Removed from v.595  
changed lines
  Added in v.770

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