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

SCM Repository

[diderot] Annotation of /branches/ein16/test/zslice1.diderot
ViewVC logotype

Annotation of /branches/ein16/test/zslice1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2377 - (view) (download)
Original Path: branches/charisee/test/zslice1.diderot

1 : jhr 1115 // zslice1.diderot
2 :    
3 :     string dataFile = "../data/zimg.nrrd";
4 :     int dataSize = 9;
5 :     int imgSize = 200;
6 :     vec3 orig = [0.0, 0.0, 4.0];
7 :     vec3 cVec = [0.0, 1.0, 0.0];
8 :     vec3 rVec = [1.0, 0.0, 0.0];
9 :     image(3)[] img = load (dataFile);
10 :     field#2(3)[] F = img ⊛ bspln3;
11 :    
12 :     strand RayCast (int row, int col)
13 :     {
14 :     real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
15 :     real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
16 :     vec3 pos = orig + rr*rVec + cc*cVec;
17 :     output real val = -∞;
18 :    
19 :     update
20 :     {
21 :     if (inside (pos,F)) {
22 :     val = 1.0;
23 :     }
24 :     stabilize;
25 :     }
26 :     }
27 :    
28 :     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