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

SCM Repository

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

Annotation of /branches/pure-cfg/test/zslice1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 770 - (view) (download)

1 : jhr 599 // zslice1.diderot
2 : glk 595
3 :     string dataFile = "../data/zimg.nrrd";
4 :     int dataSize = 9;
5 : jhr 599 int imgSize = 200;
6 : glk 595 vec3 orig = [0.0, 0.0, 4.0];
7 :     vec3 cVec = [0.0, 1.0, 0.0];
8 :     vec3 rVec = [1.0, 0.0, 0.0];
9 :     image(3)[] img = load (dataFile);
10 :     field#2(3)[] F = img ⊛ bspln3;
11 :    
12 :     strand RayCast (int row, int col)
13 :     {
14 : glk 770 real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
15 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
16 : glk 595 vec3 pos = orig + rr*rVec + cc*cVec;
17 : glk 770 output real val = -∞;
18 : glk 595
19 :     update
20 :     {
21 :     if (inside (pos,F)) {
22 : glk 770 val = 1.0;
23 : glk 595 }
24 : jhr 653 stabilize;
25 : glk 595 }
26 :     }
27 :    
28 :     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