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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 770 - (view) (download)

1 : glk 734
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 : glk 770 image(3)[] img = load("../data/zimg11.nrrd");
8 : glk 734 field#2(3)[] F = img ⊛ bspln3;
9 :    
10 :     strand RayCast (int row, int col)
11 :     {
12 : glk 770 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 : glk 734 vec3 pos = orig + rr*rVec + cc*cVec;
15 :     output real val = 0.0;
16 :    
17 :     update
18 :     {
19 :     if (inside (pos,F)) {
20 :     // HEY (bug?) is this the way to take the trace of the Hessian?
21 :     // currently this causes:
22 :     // uncaught exception Fail [Fail: sigOf: invalid operator Trace<tensor[3,3]>]
23 :     // raised at high-il/check-high-il.sml:68.19-68.71
24 :     val = trace(∇∇F@pos);
25 :     }
26 :     stabilize;
27 :     }
28 :     }
29 :    
30 :     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