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 770 - (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 : glk 742 //field#2(3)[] F = (load("../data/zimg112.nrrd")) ⊛ bspln3;
13 : jhr 744 // It is valid syntax, but there is a bug in the conversion from HighIL to MidIL
14 : glk 733
15 : glk 742 image(3)[] img = load("../data/zimg112.nrrd");
16 : jhr 625 //field#2(3)[] F = img ⊛ bspln3;
17 : jhr 647 //field#2(3)[] F = img ⊛ ctmr;
18 : glk 733 //field#0(3)[] F = img ⊛ tent;
19 : glk 742 field#1(3)[] F = img ⊛ c1tent;
20 : glk 596
21 :     strand RayCast (int row, int col)
22 :     {
23 : glk 770 real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
24 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
25 : glk 596 vec3 pos = orig + rr*rVec + cc*cVec;
26 : glk 770 output real val = -∞;
27 : glk 596
28 :     update
29 :     {
30 :     if (inside (pos,F)) {
31 : glk 770 val = F@pos;
32 : glk 596 }
33 : jhr 653 stabilize;
34 : glk 596 }
35 :     }
36 :    
37 :     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