//Example macro that does a diffusion analysis on a results table of tracking data //The required format is as generated by the Manual Tracking plugin //http://rsbweb.nih.gov/ij/plugins/track/track.html //assuming Results Table column headings; Track > Slice > X > Y //It requires many tracks and many time points! //Plots the cumulative mean squared displacement (MSD) per time point //For a more accurate approach see the time ensemble average example dis2 = 0; for (i=0; igetResult("Track", i-1)) {setResult("Dis^2", i, 0);} else { B9 = getResult("X", i); B8 = getResult("X", i-1); C9 = getResult("Y", i); C8 = getResult("Y", i-1); disx=(B9-B8)*(B9-B8); disy=(C9-C8)*(C9-C8); dis2 = (disx+disy); setResult("Dis^2", i, dis2); } } } updateResults; //get last slice maxslice = 0; for (b=0; bmaxslice) { maxslice = getResult("Slice",b); } else{}; } //get first slice minslice = maxslice; for (c=0; c