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

SCM Repository

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

View of /branches/vis12/test/vr-MIP.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1927 - (download) (annotate)
Sat Jun 23 18:09:16 2012 UTC (7 years ago) by jhr
File size: 1853 byte(s)
  converting to use "image" instead of "load" for image nrrd loading
// vr-MIP.diderot
//
// maximum intensity projection in Diderot
//

input real stepSz = 0.1;	// size of steps
				// e.g. 0.1
input vec3 eye;			// location of eye point
				// e.g. txs: (25,15,10)
                                //   vox1,x: (-8,2,2)
                                //   vox1,y: (2,-8,2)
                                //   vox1,z: (2,2,-8)
                                //  vfrhand: (127.331,-1322.05,272.53)
input vec3 orig;		// location of pixel (0,0)
				// e.g. txs: (8.83877,2.5911,7.65275)  
				//   vox1,x: (0,3.4036,3.4036)
				//   vox1,y: (0.596402,0,3.4036)
				//   vox1,z: (3.4036,3.4036,0)
                                //  vfrhand: (122.835,17.7112,188.044)
input vec3 cVec;		// vector between pixels horizontally
				// e.g. txs: (-0.0151831,0.0278357,0)
				//   vox1,x: (0,-0.014036,0)
				//   vox1,y: (0.014036,0,0)
				//   vox1,z: (-0.014036,0,0)
                                //  vfrhand: (-0.00403611,-0.029826,-0.244066)
input vec3 rVec;		// vector between pixels vertically
				// e.g. txs: (0.0074887,0.00408474,-0.0305383)
				//   vox1,x: (0,0,-0.014036)
				//   vox1,y: (0,0,-0.014036)
				//   vox1,z: (0,-0.014036,0)
                                //  vfrhand: (-0.245595,-0.0112916,0.00544129)

input image(3)[] img = load (dataFile);

//field#1(3)[] F = convolve (bspln3, img);
field#2(3)[] F = img ⊛ bspln3;

strand RayCast (int row, int col)
{
    vec3 pos = orig + real(row)*rVec + real(col)*cVec;
    vec3 dir = normalize(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