Folks,
Developing script to batch process large amounts of files. Objective is to quantify surface pore sizes. See attached function. For the most part this work flow (histogram stretch, median filter, auto local threshold, etc.) has worked fine.
However, sometimes the SEM images will pick up artifacts (#2) in attached picture and is perceived as open pore like #1. If I bump up the median filter radius > 2, the artifact will diminish, but some legitimate pore structures also suffer.
Is there a more robust flow that I should consider to minimize picking up the artifacts?
Neil
function analysis(img_filename,fil_num) {
// stripping off extensions to start with base file name //
r=img_filename;
title=getTitle();
baset=substring(title,0,12);
saveAs("tiff", dir2 + baset + "_a" + fil_num); // saving cropped image
// 16 color map and image filter (Bandpass) //
run("16_colors");
run("Enhance Contrast...", "saturated=0.0 normalize");
run("Median...", "radius=1");
//run("Bandpass Filter...", "filter_large=1000 filter_small=1 suppress=None tolerance=5 autoscale saturate");
saveAs("jpeg",dir2 + baset + "_a" + fil_num + "_16col_filt");
// Thresholding - Specific Only //
//setThreshold(0, 60);
run("Auto Local Threshold", "method=Phansalkar radius=15 parameter_1=.5 parameter_2=.5 white");
setOption("BlackBackground", false);
run("Convert to Mask");
run("Remove Outliers...", "radius=1 threshold=50 which=Bright");
run("Despeckle");
saveAs("tiff",dir2 + baset + "_a" + fil_num + "__bin"); // saving binary image
}