// Dynamic Stats and Histogram Tools // // These two macro tools demonstrate how to perform dynamic measurements by // dragging an ROI around. The "Dynamic Stats Tool" displays statistics in a text // window and the "Dynamic Histogram Tool" displays a histogram in a plot window. // // Copy this file to the ImageJ/macros/toolsets folder and these macros will // appear in the ">>" toolbar menu. var xroi,yroi,x,y,x1,y1; var leftClick=16; var size = 50; macro "Dynamic Stats Tool - C000T1d12dT9d12S" { getCursorLoc(x, y, z, flags); if (selectionType==-1) makeRectangle(x-size/2, y-size/2, size, size); getSelectionCoordinates(xroi,yroi); l=xroi.length; xdroi = newArray(l); ydroi = newArray(l); stype = selectionType(); title1 = "Dynamic Stats"; title2 = "["+title1+"]"; f = title2; if (!isOpen(title1)) run("New... ", "name="+title2+" type=[Text File] width=20 height=6"); while (flags&leftClick!=0) { getCursorLoc(x1, y1, z, flags); for (i=0;i