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

SCM Repository

[diderot] View of /branches/charisee/ertest/vispaper/iso3d/cresamp.diderot
ViewVC logotype

View of /branches/charisee/ertest/vispaper/iso3d/cresamp.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3066 - (download) (annotate)
Sat Mar 14 16:34:25 2015 UTC (4 years, 6 months ago) by cchiw
File size: 1341 byte(s)
load->image, det(), S*T
/*

../../../bin/diderotc cresamp.diderot \
 && ./cresamp \
 && unu reshape -i cresamp.txt -s 30 30 30 | \
    unu dnorm -o tmp.nrrd \
 && unu minmax tmp.nrrd

*/

int sz0 = 30;
int sz1 = 30;
int sz2 = 30;
real width = 2;
vec3 spc = [width/(sz0-1), width/(sz1-1), width/(sz2-1)];

vec3 pp = [0.0,0.0,0.0];
vec3 xdir = [spc[0], 0.0, 0.0];
vec3 ydir = [0.0, spc[1], 0.0];
vec3 zdir = [0.0, 0.0, spc[2]];
vec3 orig = -(xdir*(sz0-1) + ydir*(sz1-1) + zdir*(sz2-1))/2;

field#2(3)[] V= bspln3 ⊛ image("parab0.nrrd");
//field#2(3)[] V= bspln3 ⊛ image("twist0.nrrd");  // just for flow-line curvature

field#1(3)[3] N = ∇V/|∇V|;
field#1(3)[3,3] P = identity[3] - N⊗N;
field#0(3)[3,3] H = ∇⊗∇V;
field#0(3)[3,3] G = -(P•H•P)/|∇V|;
field#0(3)[3,3] F = -(P•H•(N⊗N))/|∇V|;

//field#0(3)[] func = trace(G); // mean curvature
field#0(3)[] func = G:G;        // square of total curvature; *can* do
//field#0(3)[] func = |G|;        // total curvature; can't do

// NOTE have to use twist0.nrrd for this
//field#0(3)[] func = F:F; // square of flow-line curvature; *can* do!


strand sample(int xi, int yi, int zi) {
  output real vv = 0;
  update {
    vec3 p  = orig + xi*xdir + yi*ydir + zi*zdir;
    vv = func(p);
    stabilize;
  }
}
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