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

SCM Repository

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

Annotation of /tests/new-tests/zslice2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (view) (download)

1 : glk 4640 // zslice2
2 :     //
3 :     // process output with:
4 :     // unu 2op exists val.nrrd 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 :     //field#0(3)[] F = img ⊛ tent;
16 :    
17 :     strand RayCast (int row, int col)
18 :     {
19 :     real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
20 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
21 :     vec3 pos = orig + rr*rVec + cc*cVec;
22 :     output real val = -∞;
23 :    
24 :     update {
25 :     if (inside (pos,F)) {
26 :     val = F(pos);
27 :     }
28 :     stabilize;
29 :     }
30 :     }
31 :    
32 :     //create_array { RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) }
33 :     initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];
34 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0