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

SCM Repository

[diderot] Annotation of /branches/charisee/ertest/vispaper/tiso3d/resamp.diderot
ViewVC logotype

Annotation of /branches/charisee/ertest/vispaper/tiso3d/resamp.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3109 - (view) (download)

1 : glk 3090 /*
2 :    
3 :     to run:
4 :    
5 :     ../../../bin/diderotc resamp.diderot \
6 :     && ./resamp \
7 : glk 3102 && unu reshape -i resamp.txt -s 60 60 60 | \
8 : glk 3090 unu dnorm -o tmp.nrrd \
9 :     && unu minmax tmp.nrrd
10 :    
11 :     */
12 :    
13 : glk 3102 int sz0 = 60;
14 :     int sz1 = 60;
15 :     int sz2 = 60;
16 :     real width = 59;
17 : glk 3090 vec3 spc = [width/(sz0-1), width/(sz1-1), width/(sz2-1)];
18 :    
19 :     vec3 pp = [0.0,0.0,0.0];
20 :     vec3 xdir = [spc[0], 0.0, 0.0];
21 :     vec3 ydir = [0.0, spc[1], 0.0];
22 :     vec3 zdir = [0.0, 0.0, spc[2]];
23 :     vec3 orig = -(xdir*(sz0-1) + ydir*(sz1-1) + zdir*(sz2-1))/2;
24 :    
25 : glk 3106 field#2(3)[3,3] V= bspln3 ⊛ image("tball.nrrd");
26 :    
27 :     // BUG: [resamp.diderot:26.34] Error: syntax error; try deleting "identity"
28 : glk 3109 field#2(3)[3,3] E = V - trace(V)*identity[3]/3;
29 : glk 3106
30 :     // either of these should work as definition of tensor FA
31 : glk 3109 field#2(3)[] F = sqrt(3.0*E:E/(2.0*V:V));
32 : glk 3106 //field#2(3)[] F = sqrt(3.0/2.0)*|E|/|V|;
33 : glk 3090
34 :     strand sample(int xi, int yi, int zi) {
35 :     output real vv = 0;
36 :     update {
37 :     vec3 p = orig + xi*xdir + yi*ydir + zi*zdir;
38 : glk 3102 vv = F(p);
39 : glk 3090 stabilize;
40 :     }
41 :     }
42 :     initially [ sample(xi, yi, zi) | zi in 0..(sz2-1), yi in 0..(sz1-1), xi in 0..(sz0-1) ];

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