|
Hi, now I'm trying to preserve only the biggest particle of my segmentation result.
First i can convert the result into a binary image and then apply a particle count that returns me information as the area of each particle. But, how can I do for preserving only the biggest one and deleting the rest by script?
here I show you my previous piece of script
#IJ.run("8-bit");
#IJ.run("Enhance Contrast", "saturated=0.4");
#IJ.run("Bandpass Filter...", "filter_large=40 filter_small=3 suppress=None tolerance=5 autoscale saturate");
#IJ.run("Sharpen");
#IJ.run("Find Edges");
#IJ.run("Despeckle");
#IJ.makeRectangle(2, 15, 305, 198);
#IJ.run("Level Sets", "method=[Active Contours] use_level_sets grey_value_threshold=50 distance_threshold=0.50 advection=1 propagation=1 curvature=1 grayscale=15 convergence=0.0010 region=inside");
#IJ.run("Remove Outliers...", "radius=2 threshold=50 which=Bright");
IJ.run("Make Binary");
IJ.run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Nothing display exclude clear include summarize record add in_situ");
|