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

SCM Repository

[diderot] View of /branches/pure-cfg/test/vr-MIP-test.diderot
ViewVC logotype

View of /branches/pure-cfg/test/vr-MIP-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 585 - (download) (annotate)
Tue Mar 8 15:31:54 2011 UTC (8 years, 8 months ago) by jhr
File size: 899 byte(s)
  Test driver
// vr-MIP-test.diderot
//
// test version of maximum intensity projection in Diderot
//

string dataFile = "../data/vox1.nrrd";
real stepSz = 0.1;
vec3 eye = [-8.0, 2.0, 2.0];
vec3 orig = [0.0, 3.4036, 3.4036];
vec3 cVec = [0.0, -0.014036, 0.0];
vec3 rVec = [0.0, 0.0, -0.014036];
image(3)[] img = load (dataFile);
field#2(3)[] F = img ⊛ bspln3;

strand RayCast (int row, int col)
{
    int r = row; // for debugging
    int c = col; // for debugging
    vec3 pos = orig + real(row)*rVec + real(col)*cVec;
    vec3 dir = (pos - eye)/|pos - eye|;
    real t = 0.0;
    output real maxval = -∞; 

    update
    {
        pos = pos + stepSz*dir;
        if (inside (pos,F)) {
	  real val = F@pos;
	  maxval = max(val, maxval);
	}
        if (t > 20.0)
            stabilize;
        t = t + stepSz;
    }

    /* render: output maxval */
}

initially [ RayCast(r, c) | r in 0..199, c in 0..199 ];

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