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

SCM Repository

[diderot] View of /branches/charisee_dev/test/zslice1.diderot
ViewVC logotype

View of /branches/charisee_dev/test/zslice1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3269 - (download) (annotate)
Fri Oct 9 00:54:03 2015 UTC (3 years, 10 months ago) by cchiw
File size: 793 byte(s)
dev branch
// zslice1.diderot
//unu reshape -i zslice1.txt -s 200 200 | unu 2op exists - 0.1 | unu quantize -b 8 -o zslice1.png


string dataFile = "../data/zimg.nrrd";
int dataSize = 9;
int imgSize = 200;
vec3 orig = [0.0, 0.0, 4.0];
vec3 cVec = [0.0, 1.0, 0.0];
vec3 rVec = [1.0, 0.0, 0.0];
image(3)[] img = image (dataFile);
field#2(3)[] F = img ⊛ bspln3;

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 = 1.0;
	}
        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