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

SCM Repository

[diderot] Annotation of /branches/vis12/test/zslice2.diderot
ViewVC logotype

Annotation of /branches/vis12/test/zslice2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1368 - (view) (download)
Original Path: trunk/test/zslice2.diderot

1 : jhr 1115 // zslice2
2 :     //
3 :     // process output with:
4 : jhr 1368 // unu reshape -i zslice2.txt -s 200 200 | unu 2op exists - 0.1 | unu quantize -b 8 -o zslice2.png
5 : jhr 1115
6 :     int dataSize = 11;
7 :     int imgSize = 200;
8 :     vec3 orig = [0.0, 0.0, 5.0];
9 :     vec3 cVec = [0.0, 1.0, 0.0];
10 :     vec3 rVec = [1.0, 0.0, 0.0];
11 :    
12 :     image(3)[] img = load("../data/zimg112.nrrd");
13 :     // 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 :     //field#2(3)[] F = img ⊛ ctmr;
19 :     //field#0(3)[] F = img ⊛ tent;
20 :     //field#1(3)[] F = img ⊛ c1tent;
21 :    
22 :     strand RayCast (int row, int col)
23 :     {
24 :     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 :     vec3 pos = orig + rr*rVec + cc*cVec;
27 :     output real val = -∞;
28 :    
29 :     update
30 :     {
31 :     if (inside (pos,F)) {
32 : jhr 1368 val = F(pos);
33 : jhr 1115 }
34 :     stabilize;
35 :     }
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