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

SCM Repository

[diderot] Diff of /branches/charisee_dev/examples/dti/dti-vr-byhand.diderot
ViewVC logotype

Diff of /branches/charisee_dev/examples/dti/dti-vr-byhand.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3312, Fri Oct 16 20:11:52 2015 UTC revision 3313, Sat Oct 17 00:33:40 2015 UTC
# Line 1  Line 1 
1  input real isoval = 0.5;  input real isoval = 0.5;
2  input real thick = 0.8;  input real thick = 0.8;
3  field#2(3)[3,3] V = bspln3 ⊛ image("../ertest/data/tball.nrrd");  field#2(3)[3,3] V = bspln3 ⊛ image("tball.nrrd");
4  field#0(3)[3,3,3] G=∇⊗V;  field#0(3)[3,3,3] G=∇⊗V;
5  field#2(3)[3] hackRGB = bspln3 ⊛ image("../data/const-curl3d.nrrd");  field#2(3)[3] hackRGB = bspln3 ⊛ image("const-curl3d.nrrd");
6  function vec3 color(vec3 x) = hackRGB(x);  function vec3 color(vec3 x) = hackRGB(x);
7  vec3 cutVec = [-1,-0.03,0.02];  vec3 cutVec = [-1,-0.03,0.02];
8  real cutPos = -1.5;  real cutPos = -1.5;
# Line 45  Line 45 
45      if (inside(x,V) && (x - camAt)•normalize(cutVec) > cutPos) {      if (inside(x,V) && (x - camAt)•normalize(cutVec) > cutPos) {
46        real val = 0;        real val = 0;
47        vec3 grad = [0,0,0];        vec3 grad = [0,0,0];
   
   
48        real m=|V(x)|;        real m=|V(x)|;
49        tensor[3,3,3] g=G(x);        tensor[3,3,3] g=G(x);
50       tensor[3] t1=(1/2)*(V(x):g+g:V(x))/m;       tensor[3] t1=(1/2)*(V(x):g+g:V(x))/m;
   
51      vec3 t2=[g[0,0,0]+g[0,1,1]+g[0,2,2],g[1,0,0]+g[1,1,1]+g[1,2,2],g[2,0,0]+g[2,1,1]+g[2,2,2]];      vec3 t2=[g[0,0,0]+g[0,1,1]+g[0,2,2],g[1,0,0]+g[1,1,1]+g[1,2,2],g[2,0,0]+g[2,1,1]+g[2,2,2]];
52      tensor [3,3] E = V(x) - trace(V(x))*identity[3]/3;      tensor [3,3] E = V(x) - trace(V(x))*identity[3]/3;
53      tensor[3,3,3] t3= g-t2⊗identity[3]/3;      tensor[3,3,3] t3= g-t2⊗identity[3]/3;
54      real t4=|E|;      real t4=|E|;
55     tensor [3] t5=(1/2)*(t3:E +E:t3)/(E:E);     tensor [3] t5=(1/2)*(t3:E +E:t3)/(E:E);
56    val=sqrt(3.0/2.0)*t4/m - isoval;    val=sqrt(3.0/2.0)*t4/m - isoval;
57  real t8=sqrt(3.0/2.0);      vec3 t6 =m*t5;
58    vec3 t6 =(m*t5);      vec3 t7 = t4*t1;
59    vec3 t7 = (t4*t1);      grad =sqrt(3.0/2.0)*(t6- t7)/(m*m);
  grad =t8*(t6- t7)/(m*m);  
   
60        real a = alpha(val, |grad|);        real a = alpha(val, |grad|);
61        if (a > 0) {        if (a > 0) {
62          a = 1 - pow(1-a, rayStep);          a = 1 - pow(1-a, rayStep);

Legend:
Removed from v.3312  
changed lines
  Added in v.3313

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