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

SCM Repository

[diderot] View of /trunk/test/zslice2.diderot
ViewVC logotype

View of /trunk/test/zslice2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2636 - (download) (annotate)
Tue May 27 16:18:36 2014 UTC (5 years, 3 months ago) by jhr
File size: 1052 byte(s)
  Merging changes from vis12 branch (via staging).  The main change is the new
  syntax for inputs (especially image inputs).
// zslice2 
//
// process output with:
// unu reshape -i zslice2.txt -s 200 200 | unu 2op exists - 0.1 | unu quantize -b 8 -o zslice2.png

int dataSize = 11;
int imgSize = 200;
vec3 orig = [0.0, 0.0, 5.0];
vec3 cVec = [0.0, 1.0, 0.0];
vec3 rVec = [1.0, 0.0, 0.0];

image(3)[] img = image("../data/zimg112.nrrd");
// HEY (bug) bspln5 leads to problems:
//  uncaught exception Size [size]
//    raised at c-target/c-target.sml:47.15-47.19
//field#4(3)[] F = img ⊛ bspln5;
field#2(3)[] F = img ⊛ bspln3;
//field#2(3)[] F = img ⊛ ctmr;
//field#0(3)[] F = img ⊛ tent;
//field#1(3)[] F = img ⊛ c1tent;

strand RayCast (int row, int col)
{
    real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
    real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
    vec3 pos = orig + rr*rVec + cc*cVec;
    output real val = -∞; 

    update
    {
        if (inside (pos,F)) {
          val = F(pos);
	}
        stabilize;
    }
}

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