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

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/zslice-etest.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/zslice-etest.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1536 - (view) (download)

1 : glk 1536
2 :     int dataSizeX = 71;
3 :     int dataSizeY = 45;
4 :     int imgSizeX = 10*dataSizeX;
5 :     int imgSizeY = 10*dataSizeY;
6 :     vec3 orig = [0.0, 0.0, 6.0];
7 :     vec3 xVec = [1.0, 0.0, 0.0];
8 :     vec3 yVec = [0.0, 1.0, 0.0];
9 :     image(3)[] img = load("../data/etest.nrrd");
10 :     field#2(3)[] F = img ⊛ bspln3;
11 :    
12 :     strand sample (int xi, int yi) {
13 :     real xx = lerp(-0.5, real(dataSizeX)-0.5, -0.5, real(xi), real(imgSizeX)-0.5);
14 :     real yy = lerp(-0.5, real(dataSizeY)-0.5, -0.5, real(yi), real(imgSizeY)-0.5);
15 :     vec3 pos = orig + xx*xVec + yy*yVec;
16 :     output real val = 0.0;
17 :    
18 :     update
19 :     {
20 :     if (inside (pos,F)) {
21 :     tensor[3,3] H = ∇⊗∇F(pos);
22 :     //val = trace(H);
23 :     vec3{3} v = evecs(H);
24 :     real{3} l = evals(H);
25 :     tensor[3,3] R = l{0}*v{0}⊗v{0} + l{1}*v{1}⊗v{1} + l{2}*v{2}⊗v{2};
26 :     val = |H - R|;
27 :     }
28 :     stabilize;
29 :     }
30 :     }
31 :    
32 :     initially [ sample(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

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