//WH_NJ macro //initial post-processing, doesn't require modification run("8-bit"); run("Sharpen", "stack"); run("Find Edges", "stack"); setAutoThreshold("Default"); //run("Threshold..."); setAutoThreshold("Huang"); setOption("BlackBackground", true); run("Convert to Mask", "method=Default background=Dark calculate black"); //post-processing required to remove any holes that may exist outside the main scratch. User may need to adjust the counts and iterations, according the sizes of undesirable holes run("Options...", "iterations=4 count=3 do=Open stack"); run("Options...", "iterations=1 count=1 do=[Fill Holes] stack"); //standard attributes to calculate the main scratch. May vary according the size (0-infinity) of image. For our usage we calibrate ImageJ using "mm" as unit of length (ratio of 280 pixels / mm) and the user can increase or decrease this value by 0.05 to 0.05 points run("Analyze Particles...", "size=0.1-Infinity show=[Overlay Outlines] display summarize add stack"); //this command request the user to open the last used image, for overlaying the image with the calculated area open(); run("Sharpen", "stack"); run("From ROI Manager"); run("Overlay Options...", "stroke=black width=3 fill=none apply set"); //choose the destination directory to save all overlapped images run("Image Sequence... ", "format=JPEG use save=[]");