Use of Scanning Electron Microscope Image for Particle Analyze to Defined Pore Diameter and Pore space

Good Morning to Forum

Please help me out from scripting with better programming in below macro code which is run on SEM images and stored data in output folder.

SEM Image = J2-1.tif (1.2 MB)

Macro Code =

// Program for Identification of Pore Radius by using Particle Analyze
// How to generate standard code for below Macro code and add in plugin ?
// Each and every time running this code Before it Ask value of a,b,c,d,e
run(“Threshold Image”, “threshold=” +a);
run(“Invert”);
run(“Gaussian Weighted Median”, “radius=” +b);
run(“Make Binary”);
run(“EDM Binary Operations”, “iterations=c operation=open”);
run(“EDM Binary Operations”, “iterations=d operation=erode”);
run(“EDM Binary Operations”, “iterations=e operation=open”);
run(“Analyze Particles…”, " show=Outlines display include summarize add in_situ");
// save each file before close ( This files= summary, result, Threshold Image)
saveAs(“Results”, “D:/Shubham file/M.Tech Project/SEM Data _ ImageJ/Running code data/Practical_J2/Output/Summary.csv”);
saveAs(“Results”, “D:/Shubham file/M.Tech Project/SEM Data _ ImageJ/Running code data/Practical_J2/Output/Results.csv”);
saveAs(“Tiff”, “D:/Shubham file/M.Tech Project/SEM Data _ ImageJ/Running code data/Practical_J2/Output/Threshold Image.tif”);
run(“Close”);
run(“Close All”);

I want to apply above code on different SEM image for defining Pore Diameter by using Particle Analyze.
Please help me out to run this code on each SEM image easily.

Thank you for Consideration.

Sincerely,
Shubham Saraf (Designation : Masters in Petroleum Engineering)
Pandit Deendayal Petroleum University, Gujarat, India.

@Shubh94

If you want to get starting scripting with ImageJ - here are some helpful links:

I would very much recommend using Script Parameters instead of hard-coding file paths in your scripts…

Do you have specific questions regarding the script above and why exactly things aren’t working for you? Though before we go there… take the time to go through the links provided - you might find answers there without needing more assistance.

But for sure - we are here to help if needed. :slight_smile: