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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 733 - (view) (download)

1 : glk 733 // zslice2
2 : glk 596
3 :     int dataSize = 11;
4 :     int imgSize = 200;
5 : jhr 647 vec3 orig = [0.0, 0.0, 5.0];
6 : glk 596 vec3 cVec = [0.0, 1.0, 0.0];
7 :     vec3 rVec = [1.0, 0.0, 0.0];
8 : glk 733 // HEY (bug), next line causes:
9 :     // uncaught exception Fail [Fail: Error in compiling zslice2.diderot]
10 :     // raised at driver/main.sml:31.39-31.76
11 :     // but is this not valid syntax for creating field in one shot?
12 :     field#2(3)[] F = (load("../data/zimg112.nrrd")) ⊛ bspln3;
13 :    
14 :     //image(3)[] img = load("../data/zimg112.nrrd");
15 : jhr 625 //field#2(3)[] F = img ⊛ bspln3;
16 : jhr 647 //field#2(3)[] F = img ⊛ ctmr;
17 : glk 733 //field#0(3)[] F = img ⊛ tent;
18 : glk 596
19 :     strand RayCast (int row, int col)
20 :     {
21 :     real rr = real(dataSize)*(real(row)+0.5)/real(imgSize) - 0.5;
22 :     real cc = real(dataSize)*(real(col)+0.5)/real(imgSize) - 0.5;
23 :     vec3 pos = orig + rr*rVec + cc*cVec;
24 :     output real maxval = -∞;
25 :    
26 :     update
27 :     {
28 :     if (inside (pos,F)) {
29 :     maxval = F@pos;
30 :     }
31 : jhr 653 stabilize;
32 : glk 596 }
33 :     }
34 :    
35 :     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