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

SCM Repository

[diderot] View of /branches/vis12/test/fields.diderot
ViewVC logotype

View of /branches/vis12/test/fields.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1685 - (download) (annotate)
Sun Jan 22 15:23:36 2012 UTC (7 years, 9 months ago) by jhr
File size: 983 byte(s)
  Create a branch to implement things that we need for the Vis 2012 paper
// fields
//
// documents bugs in field expressions
// process output with:
// unu reshape -i mip.txt -s 2 300 200 | unu pad -min 0 0 0 -max 2 M M -b wrap | unu quantize -b 8  -o fields.png


int imgSizeX = 300;
int imgSizeY = 200;

image(2)[2] Vimg = load("../data/vorttest.nrrd");

field#1(2)[2] Vpos = Vimg ⊛ ctmr;
field#1(2)[2] V1 = -Vpos;

field#1(2)[2] V2 = 1.0*(Vimg ⊛ ctmr);

field#1(2)[2] V3 = Vpos;

field#1(2)[2] V4 = Vpos + Vpos;

//image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
field#0(2)[] R = load("../data/vorttest-rand.nrrd") ⊛ tent;

strand LIC (int xi, int yi) {
    real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
    real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
    vec2 pos = [xx,yy];
    output vec2 v = [0.0,0.0];

    update {
        v = (V1(pos) + V2(pos) + V3(pos) + V4(pos)) * R(pos);
        v = -V1(pos);
        stabilize;
    }
}

initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

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