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 777 - (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 : glk 777 // HEY (bug) bspln5 leads to problems:
17 :     // uncaught exception Size [size]
18 :     // raised at c-target/c-target.sml:47.15-47.19
19 :     //field#4(3)[] F = img ⊛ bspln5;
20 :     field#2(3)[] F = img ⊛ bspln3;
21 : jhr 647 //field#2(3)[] F = img ⊛ ctmr;
22 : glk 733 //field#0(3)[] F = img ⊛ tent;
23 : glk 777 //field#1(3)[] F = img ⊛ c1tent;
24 : glk 596
25 :     strand RayCast (int row, int col)
26 :     {
27 : glk 770 real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
28 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
29 : glk 596 vec3 pos = orig + rr*rVec + cc*cVec;
30 : glk 770 output real val = -∞;
31 : glk 596
32 :     update
33 :     {
34 :     if (inside (pos,F)) {
35 : glk 770 val = F@pos;
36 : glk 596 }
37 : jhr 653 stabilize;
38 : glk 596 }
39 :     }
40 :    
41 :     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