// Smooth_ROI.txt // G. Landini at bham. ac. uk // 13/2/2011 // Performs a running average of size 3 on a closed ROI to smooth it sel=selectionType(); if (sel<2 ||sel>4) exit("Only freehand closed ROIs are supported."); getSelectionCoordinates(x, y); run("Select None"); makeSelection("polygon", x, y); l=x.length; //print(l); nx=newArray(l); ny=newArray(l); for (i=1; i0) { nex=newArray(l-tot); ney=newArray(l-tot); nex[0]=nx[0]; ney[0]=ny[0]; st=0; for (j=1; j