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

SCM Repository

[diderot] Annotation of /trunk/test/zslice-hess.diderot
ViewVC logotype

Annotation of /trunk/test/zslice-hess.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2636 - (view) (download)

1 : jhr 1115
2 :     int dataSize = 11;
3 :     int imgSize = 200;
4 :     vec3 orig = [0.0, 0.0, 5.0];
5 :     vec3 cVec = [0.0, 1.0, 0.0];
6 :     vec3 rVec = [1.0, 0.0, 0.0];
7 : jhr 2636 image(3)[] img = image("../data/zimg11.nrrd");
8 : jhr 1115 field#2(3)[] F = img ⊛ bspln3;
9 :    
10 :     strand RayCast (int row, int col)
11 :     {
12 :     real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
13 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
14 :     vec3 pos = orig + rr*rVec + cc*cVec;
15 :     output real val = 0.0;
16 :    
17 :     update
18 :     {
19 :     if (inside (pos,F)) {
20 : jhr 1383 tensor[3,3] H = ∇⊗∇F(pos);
21 :     val = trace(∇⊗∇F(pos));
22 : jhr 1115 // can compare with following; tests subscripting
23 :     // val = H[0,0] + H[1,1] + H[2,2];
24 :     }
25 :     stabilize;
26 :     }
27 :     }
28 :    
29 :     initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];

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