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

SCM Repository

[diderot] Annotation of /branches/vis15/src/tests/new-tests/zslice2.diderot
ViewVC logotype

Annotation of /branches/vis15/src/tests/new-tests/zslice2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3619 - (view) (download)

1 : jhr 3619 // zslice2
2 :     //
3 :     // process output with:
4 :     // unu reshape -i zslice2.txt -s 200 200 | unu 2op exists - 0.1 | unu quantize -b 8 -o zslice2.png
5 :    
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 = image("data/zimg112.nrrd");
13 :    
14 :     field#2(3)[] F = img ⊛ bspln3;
15 :    
16 :     strand RayCast (int row, int col)
17 :     {
18 :     real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
19 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
20 :     vec3 pos = orig + rr*rVec + cc*cVec;
21 :     output real val = -∞;
22 :    
23 :     update
24 :     {
25 :     if (inside (pos,F)) {
26 :     val = F(pos);
27 :     }
28 :     stabilize;
29 :     }
30 :     }
31 :    
32 :     grid (2) { 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