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 653 - (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 608 real rr = real(dataSize)*(real(row)+0.5)/real(imgSize) - 0.5;
15 :     real cc = real(dataSize)*(real(col)+0.5)/real(imgSize) - 0.5;
16 : glk 595 vec3 pos = orig + rr*rVec + cc*cVec;
17 :     output real maxval = -∞;
18 :    
19 :     update
20 :     {
21 :     // HEY region for this should be exactly centered in the image
22 :     if (inside (pos,F)) {
23 : jhr 599 maxval = 1.0;
24 : glk 595 }
25 : jhr 653 stabilize;
26 : glk 595 }
27 :    
28 :     /* render: output maxval */
29 :     }
30 :    
31 :     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