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 1352 - (view) (download)

1 : glk 733 // zslice2
2 : glk 1022 //
3 :     // process output with:
4 : jhr 1325 // unu reshape -i zslice2.txt -s 200 200 | unu 2op exists - 0.1 | unu quantize -b 8 -o zslice2.png
5 : glk 596
6 :     int dataSize = 11;
7 :     int imgSize = 200;
8 : jhr 647 vec3 orig = [0.0, 0.0, 5.0];
9 : glk 596 vec3 cVec = [0.0, 1.0, 0.0];
10 :     vec3 rVec = [1.0, 0.0, 0.0];
11 : glk 733
12 : glk 742 image(3)[] img = load("../data/zimg112.nrrd");
13 : glk 777 // HEY (bug) bspln5 leads to problems:
14 :     // uncaught exception Size [size]
15 :     // raised at c-target/c-target.sml:47.15-47.19
16 :     //field#4(3)[] F = img ⊛ bspln5;
17 :     field#2(3)[] F = img ⊛ bspln3;
18 : jhr 647 //field#2(3)[] F = img ⊛ ctmr;
19 : glk 733 //field#0(3)[] F = img ⊛ tent;
20 : glk 777 //field#1(3)[] F = img ⊛ c1tent;
21 : glk 596
22 :     strand RayCast (int row, int col)
23 :     {
24 : glk 770 real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
25 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
26 : glk 596 vec3 pos = orig + rr*rVec + cc*cVec;
27 : glk 770 output real val = -∞;
28 : glk 596
29 :     update
30 :     {
31 :     if (inside (pos,F)) {
32 : jhr 1352 val = F(pos);
33 : glk 596 }
34 : jhr 653 stabilize;
35 : glk 596 }
36 :     }
37 :    
38 :     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