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 646 - (download) (annotate)
Thu Mar 17 21:23:22 2011 UTC (8 years, 8 months ago) by jhr
File size: 1183 byte(s)
  test on hand data
// vr-MIP-test.diderot
//
// test version of maximum intensity projection in Diderot
//

//string dataFile = "../data/txs.nrrd";
//vec3 eye = [25.0, 15.0, 10.0];
//vec3 orig = [8.83877,2.5911,7.65275];
//vec3 cVec = [-0.0151831,0.0278357,0.0];
//vec3 rVec = [0.0074887,0.00408474,-0.0305383];
string dataFile = "../data/vfrhand-nohip.nhdr";
vec3 eye = [127.331,-1322.05,272.53];
vec3 orig = [122.835,17.7112,188.044];
vec3 cVec = [-0.00403611,-0.029826,-0.244066];
vec3 rVec = [-0.245595,-0.0112916,0.00544129];

real stepSz = 0.5;
image(3)[] img = load (dataFile);
//field#2(3)[] F = img ⊛ bspln3;
field#0(3)[] F = img ⊛ tent;

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 > 80.0)
            stabilize;
        t = t + stepSz;
    }

    /* render: output maxval */
}

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

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