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

SCM Repository

[diderot] Diff of /branches/lamont/test/zslice-bspln5.diderot
ViewVC logotype

Diff of /branches/lamont/test/zslice-bspln5.diderot

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

branches/vis12/test/zslice-bspln5.diderot revision 1873, Sun May 13 20:50:35 2012 UTC branches/lamont/test/zslice-bspln5.diderot revision 2081, Mon Nov 5 23:26:06 2012 UTC
# Line 8  Line 8 
8  vec3 orig = [0.0, 0.0, 5.0];  vec3 orig = [0.0, 0.0, 5.0];
9  vec3 cVec = [0.0, 1.0, 0.0];  vec3 cVec = [0.0, 1.0, 0.0];
10  vec3 rVec = [1.0, 0.0, 0.0];  vec3 rVec = [1.0, 0.0, 0.0];
11  image(3)[] img = load("../data/zimg11.nrrd");  image(3)[] img = image("../data/zimg11.nrrd");
12  field#4(3)[] F = img ⊛ bspln5;  field#4(3)[] F = img ⊛ bspln5;
 // BUG: 6-sample kernels apparently not supported  
 // all the way to code generation  
13    
14  strand RayCast (int row, int col)  strand RayCast (int row, int col)
15  {  {
16      real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);      real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
17      real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);      real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
18      vec3 pos = orig + rr*rVec + cc*cVec;      vec3 pos = orig + rr*rVec + cc*cVec;
19      output real val = 0.0;      output vec3 val = [0.0,0.0,0.0];
20    
21      update      update
22      {      {
23          if (inside (pos,F)) {          if (inside (pos,F)) {
24              tensor[3,3] H = ∇⊗∇F(pos);              tensor[3,3] H = ∇⊗∇F(pos);
25              real{3} ev = evals(H);              real{3} ev = evals(H);
26              val = ev{0} + ev{1} + ev{2};              // all three should be the same value
27                val = [ev{0} + ev{1} + ev{2},
28                       H[0,0] + H[1,1] + H[2,2],
29                       identity[3]:H];
30          }          }
31          stabilize;          stabilize;
32      }      }

Legend:
Removed from v.1873  
changed lines
  Added in v.2081

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