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

SCM Repository

[diderot] Annotation of /branches/vis12/test/zslice-grad.diderot
ViewVC logotype

Annotation of /branches/vis12/test/zslice-grad.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1927 - (view) (download)

1 : jhr 1115 // zslice-grad
2 :    
3 :     int dataSize = 11;
4 :     int imgSize = 200;
5 :     vec3 orig = [0.0, 0.0, 5.0];
6 :     vec3 cVec = [0.0, 1.0, 0.0];
7 :     vec3 rVec = [1.0, 0.0, 0.0];
8 : jhr 1927 image(3)[] img = load ("../data/zimg11.nrrd");
9 : jhr 1115 field#2(3)[] F = img ⊛ bspln3;
10 :    
11 :     strand RayCast (int row, int col)
12 :     {
13 :     real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
14 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
15 :     vec3 pos = orig + rr*rVec + cc*cVec;
16 :     output vec3 grad = [0.0, 0.0, 0.0];
17 :    
18 :     update
19 :     {
20 :     grad = ∇F@pos if inside (pos,F) else [0.0, 0.0, 0.1];
21 :     stabilize;
22 :     }
23 :    
24 :     /* output grad */
25 :     }
26 :    
27 :     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