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.diderot
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 142 - (download) (annotate)
Thu Jul 8 19:12:02 2010 UTC (9 years, 3 months ago) by jhr
Original Path: trunk/test/vr-MIP.diderot
File size: 938 byte(s)
  Update example to current syntax
// vr-MIP.diderot
//
// maximum intensity projection in Diderot
//

input string dataFile;		// name of dataset
input real stepSz;		// size of steps
input vec3 eye;			// location of eye point 
input vec3 orig;		// location of pixel (0,0)
input vec3 cVec;		// vector between pixels horizontally
input vec3 rVec;		// vector between pixels vertically

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

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

actor RayCast (int row, int col)
{
    vec3	pos = orig + real(row)*rVec + real(col)*cVec;
    vec3	dir = (pos - eye)/|pos - eye|;
    real	t = 0.0;
    real        maxval = -inf; 
    int         num = 0;

    update
    {
	vec3 pt = pos + t*dir;
	real val = F@pt;
        maxval = max(val, maxval);
	if (t > 1.0)
	    stabilize;
	t = t + stepSz;
        num = num + 1;
    }

    /* render: output maxval */
}

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

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