// Catalogue Particles.txt // G. Landini at bham. ac. uk 11/5/2006 // 1/Jul/2007 bugfixes for results table types // 2/Jun/2008 wrong table bugfix // 25/Mar/2009 tidy up // 27/Apr/2009 fixed bug using particle analyzer // 2/Jun/2009 fixed wand // 18/Feb/2014 added 32bit support // 12/Jan/2016 fixed incomplete pasting region bug // 26/Jan/2016 cleaning code // // This macro creates a Catalog of particles that can be ordered // according to some recorded morphometrical parameter. // It uses the Results table generated by either the built in Particle // Analyzer or the Particles8_ plugin. // // If using the Particle Analyzer, it needs the image thresholded (i.e. in red) // at the same grey levels used to generate the Results table (otherwise the ROIs // will not match). It also needs to record the 'Bounding Rectangle' in Set Measurements... // and 'Record Starts' in the Particle Analyzer. // // If using the Particles8_ plugin, it needs the binary image used to generate the // Results table. // // The macro can redirect the processing to other images to produce catalogs // based on 8 bit grey or RGB images, instead of the thresholded or binary particle // ones. // // Please report back any problems. title=getTitle(); run("Select None"); if (!isOpen("Results")) exit("No Results window found. Please run Analyze Particles or Particles8."); // To generate the results table: // run("Set Measurements...", "area perimeter bounding circularity integrated limit redirect=None decimal=3"); // run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Nothing display clear record"); // or // run("Particles8 ", "white morphology show=Particles minimum=0 maximum=999999 display redirect=None overwrite"); // // Make sure that you redirect the analysis to the appropriate image, if required. selectWindow("Results"); text = getInfo(); lines = split(text, "\n"); columns = split(lines[0], "\t"); if (columns[0]==" ") columns[0]= "#"; index=newArray(nResults); param=newArray(nResults); imagen=newArray(nImages); tableType=""; for (i=0;imaxr) maxr=r; } if (w>maxw) maxw=w; if (h>maxh) maxh=h; } if (par!="Number"){ for (i=0; iparam[j+1]){ temp=param[j]; param[j]=param[j+1]; param[j+1]=temp; temp=index[j]; index[j]=index[j+1]; index[j+1]=temp; sw=true; } } } } else{ while (sw){ sw=false; for(j=0;j